// Scripts

function alternaFormulario(obj) {

	var el = document.getElementById(obj);
	if (el.style.display != 'none') {
		el.style.display = 'none'; }
	else {
	el.style.display = ''; }

}

function validaFormInscricao(){

           d = document.formularioInscricao;

           //validar nome

         if (d.tx_nome.value == ""){
                   alert("O campo NOME deve ser preenchido!");
                   d.tx_nome.focus();
                   return false;
         }

			//validar cpf
         if (d.tx_cpf.value == ""){
                   alert("O campo CPF deve ser preenchido!");
                   d.tx_cpf.focus();
                   return false;
         }
		 

           //validar endereco residencial

         if (d.txt_enderecoRes.value == ""){
                   alert("O campo ENDERECO RESIDENCIAL deve ser preenchido!");
                   d.txt_enderecoRes.focus();
                   return false;
         }

           //validar cidade

         if (d.tx_cidade.value == ""){
                   alert("O campo MUNICIPIO nome deve ser preenchido!");
                   d.tx_cidade.focus();
                   return false;
         }

           //validar estado

         if (d.cb_uf.value == ""){
                   alert("O campo UF nome deve ser preenchido!");
                   d.cb_uf.focus();
                   return false;
         }

           //validar cep

         if (d.tx_CEP.value == ""){
                   alert("O campo CEP nome deve ser preenchido!");
                   d.tx_CEP.focus();
                   return false;
         }

           //validar telefone residencial

         if (d.tx_tel_casa.value == ""){
                   alert("O campo TELEFONE RESIDENCIAL nome deve ser preenchido!");
                   d.tx_tel_casa.focus();
                   return false;
         }

		  //validar e-mail

           if (d.tx_email.value == ""){
                     alert("O campo e-mail deve ser preenchido!");
                     d.tx_email.focus();
                     return false;
          }

		  //validar data de nascimento

           if (d.tx_datanasc.value == ""){
                     alert("O campo DATA DE NASCIMENTO deve ser preenchido!");
                     d.tx_datanasc.focus();
                     return false;
          }

         return true;
}

function chkboxbh() {
	
	var chkboxum = document.getElementById('bh');
	var chkboxdois = document.getElementById('brasilia');

	if (chkboxdois.checked == true)
	  chkboxdois.click();

}

function chkboxbrasilia() {
	
	var chkboxum = document.getElementById('bh');
	var chkboxdois = document.getElementById('brasilia');

	if (chkboxum.checked == true)
	  chkboxum.click();

}

function chkboxdata(obj) {

	var formularioTratado = document.getElementById("formularioInscricao").elements;
	var ck = document.getElementById(obj);

	for (x = 0; x < formularioTratado.length; x++)
	{
		if (formularioTratado[x] != ck) 
		{
			if (formularioTratado[x].checked == true)
			  formularioTratado[x].click();
		}
	}

}
