////
function validar(Form) {
	var invalid, s;
	invalid = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	var s;
// inicio de verificacao
 		if (Form.txtNome.value.length == 0) {
		alert("Nome é um campo obrigatório !");
		Form.txtNome.focus();
	        return false;	}
	
	
		if (Form.txtDiaNasc.value.length == "") {
		alert("Informe o Dia da data de Nascimento !");
		Form.txtDiaNasc.focus();
	        return false;	}
	
		if (Form.txtMesNasc.value.length == "") {
		alert("Informe o Mês da data de Nascimento !");
		Form.txtMesNasc.focus();
	        return false;	}
			
					
		if( document.Form.txtAnoNasc.value.length < 4) 
	{
			alert("Informe o ano de Nascimento !");
   			Form.txtAnoNasc.focus();
			return (false);

	}
	
	
	if (document.Form.txtSexo[0].checked!=true && document.Form.txtSexo[1].checked!=true){ 

		alert("Informe o seu Sexo"); 
		return false; 

	}
	
	    
	   if (Form.txtInstituicao.value.length == 0) {
    		alert("INSTITUIÇÃO é um campo obrigatório !");
    		Form.txtInstituicao.focus();
    		return false; }
			
			
		if (Form.txtProfissao.value.length == 0) {
    		alert("PROFISSÃO é um campo obrigatório !");
    		Form.txtProfissao.focus();
    		return false; }
	   
	   
	   	if (Form.txtEndereco.value.length == 0) {
    		alert("ENDEREÇO é um campo obrigatório !");
    		Form.txtEndereco.focus();
    		return false; }
			
			if (Form.txtNumero.value.length == 0) {
    		alert("NÚMERO é um campo obrigatório !");
    		Form.txtNumero.focus();
    		return false; }
			
			if (Form.txtBairro.value.length == 0) {
    		alert("BAIRRO é um campo obrigatório !");
    		Form.txtBairro.focus();
    		return false; }
			
			if (Form.txtCidade.value.length == 0) {
    		alert("CIDADE é um campo obrigatório !");
    		Form.txtCidade.focus();
    		return false; }
						
			if(Form.txtUF.value=="")
			{
				alert('Selecione seu Estado!');
				Form.txtUF.focus();
				return false;
			}
						
			if (Form.txtCep.value.length == 0) {
    		alert("CEP é um campo obrigatório !");
    		Form.txtCep.focus();
    		return false; }
	   
      if (Form.txtddd_tel.value.length == 0) {
    		alert("DDD é um campo obrigatório !");
    		Form.txtddd_tel.focus();
    		return false;	}

    	if (Form.txtTelefone.value.length == 0) {
    		alert("O Telefone é um campo obrigatório !");
    		Form.txtTelefone.focus();
    		return false;	}
			
			
		if (Form.txtEmail.value.length == 0) {
    		alert("O Email é um campo obrigatório !");
    		Form.txtEmail.focus();
    		return false;	}

	if (invalid.test(document.Form.txtEmail.value) == false) {
		// caso o teste falhe, para mudar a cor do texto na caixa, mude na linha abaixo
		document.Form.txtEmail.style.color = "red";
		alert("Endereço de E-mail inválido !");
		Form.txtEmail.focus();
		return (false); }
				
		if( document.Form.txtEmail.value.length < 5 || document.Form.txtEmail.value.indexOf("@") < 0 || document.Form.txtEmail.value.indexOf(".") < 0 ) 
	{
			alert("Endereço de E-mail inválido !");
   			Form.txtEmail.focus();
			return (false);

	}
		      
			
		if (Form.passwd.value.length == 0) {
    		alert("A Senha é um campo obrigatório !");
    		Form.passwd.focus();
    		return false;	}
	if (Form.confirmapassword.value.length == 0) {
    		alert("Confirme a Senha!");
    		Form.confirmapassword.focus();
    		return false;	}

			if (document.Form.txtCategoria[0].checked!=true && document.Form.txtCategoria[1].checked!=true && document.Form.txtCategoria[2].checked!=true && document.Form.txtCategoria[3].checked!=true && document.Form.txtCategoria[4].checked!=true){ 

		alert("Informe uma categoria de Filiação"); 
		return false; 

	}	
		
		//Categoria de Inscrição	
			if (!d.vlr[0].checked && !d.vlr[1].checked) {
			alert("Escolha uma categoria!")
			return false;
		}
			
	
		// verifica o cep
	// primeiro deixa somente numeros no cep
	// obs.:a chamada abaixo tambem pode ser utilizada para checar telefones
	s = limpa_string(Form.txtCep.value);
	if (s.length < 8) {
		alert("Digite corretamente o CEP: 99999999 !");
		Form.txtCep.focus();
		return false; }
	
     return true;
}






function inscricao() {

		if (!form_inscricao.vlr[0].checked && !form_inscricao.vlr[1].checked && !form_inscricao.vlr[2].checked && !form_inscricao.vlr[3].checked && !form_inscricao.vlr[4].checked) {
			alert("Escolha uma categoria!")
			return false;
		}
		return true;
		}

function inscricao_simpequi() {

		if (!form_inscricao.vlr[0].checked && !form_inscricao.vlr[1].checked && !form_inscricao.vlr[2].checked && !form_inscricao.vlr[3].checked) {
			alert("Escolha uma categoria!")
			return false;
		}
		return true;
		}


function mostra_boleto(NomeDIV){

	if(document.Form.txtCategoria[0].checked || document.Form.txtCategoria[1].checked || document.Form.txtCategoria[2].checked || document.Form.txtCategoria[3].checked){ 
	
	document.getElementById(NomeDIV).style.display = "block";}
	else{document.getElementById(NomeDIV).style.display = "none";}
	

}

function EsqueciSenha()
{
	var win = window.open("membro_sem_senha.php", "_senha","width=320,height=200,left=100,top=200,resizable=yes,status=no");
	win.focus();
}	

