function verifica() {

   if (document.responde.nome.value == "") {
		alert("Digite o seu nome");
		document.responde.nome.focus();
		return false;
	}

	if (document.responde.email.value == "") {
		alert("Informe seu e-mail.");
		document.responde.email.focus();
		return false;
	}

	if (!valida_email(document.responde.email,'E-mail inválido.')) {
		document.responde.email.focus();
      return(false); 
	} 

	if (document.responde.cidade.value == "")	{
		alert("Informe a cidade");
		document.responde.cidade.focus();
		return false;
	}

	if (document.responde.estado.selectedIndex == 0)	{
		alert("Selecione o Estado");
		document.responde.estado.focus();
		return false;
	}

	if (document.responde.estado.selectedIndex == 1)	{
		alert("Selecione o Estado");
		document.responde.estado.focus();
		return false;
	}

	if (document.responde.categoria.selectedIndex == 0) {
		alert("Selecione uma categoria");
		document.responde.categoria.focus();
		return false;
	}

	if (document.responde.categoria.selectedIndex == 1) {
		alert("Selecione uma categoria");
		document.responde.categoria.focus();
		return false;
	}

	if (document.responde.pergunta.value == "")	{
		alert("Digite uma pergunta");
		document.responde.pergunta.focus();
		return false;
	}

	//verifica se preencheu todo questionario
	var blnRespondeuTodas = true;

	for (var i=0; i<document.cadastro.elements.length; i++) {
		if (document.cadastro.elements[i].type == 'checkbox' || document.cadastro.elements[i].type == 'radio') {
			if (document.cadastro.elements[i].name.substr(0,8) == 'pergunta') {
				//verifica se eh array			
				if (eval("document.cadastro." + document.cadastro.elements[i].name+".length") == null) {
					if (!document.cadastro.elements[i].checked) {
						blnRespondeuTodas = false;
						break;
					}
				} else {
					var isChecked;
					for (var j = 0; j < eval("document.cadastro." + document.cadastro.elements[i].name+".length"); j++) {
						isChecked = eval("document.cadastro." + document.cadastro.elements[i].name+"["+j+"].checked");
						if (isChecked)
							break;
					}
					
					if (!isChecked) {
						blnRespondeuTodas = false;
						break;
					}
				}
			}
		}
	}
	
	if (!blnRespondeuTodas) {
		alert('Favor preencher todos os dados.');
		return false;
	}
		
	return true;
}

