	function vercpf (cpf) 
{
if (cpf.length != 11 || cpf == "00000000000" || cpf == "11111111111" || cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" || cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" || cpf == "88888888888" || cpf == "99999999999")
return false;
add = 0;
for (i=0; i < 9; i ++)
add += parseInt(cpf.charAt(i)) * (10 - i);
rev = 11 - (add % 11);
if (rev == 10 || rev == 11)
rev = 0;
if (rev != parseInt(cpf.charAt(9)))
return false;
add = 0;
for (i = 0; i < 10; i ++)
add += parseInt(cpf.charAt(i)) * (11 - i);
rev = 11 - (add % 11);
if (rev == 10 || rev == 11)
rev = 0;
if (rev != parseInt(cpf.charAt(10)))
return false;

return true;
}
	
	function ValidaCampos(strnm)
	{	
		d = document.Inscricao;
		ContaCampos = 0;
		
		//Cores com campo vazios ou inválidos
		CorLabelErro = "#FF0000";
		CorCampoErro = "#FFCC99";
		BordaCampoErro = "solid 1px #FF0000";
		
		//Cor padrão campos
		CorLabelOK = "#006699";
		CorCampoOK = "#FFF";
		BordaCampoOK = "solid 1px #006699";
		
		//Verifica o tipo de formulário que está validados para verificar o código do representante
		if(strnm == 'representante')
		{
			//valida o campo código do representante
			if(d.Txtcodrep.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("Lblcodrep").style.color = CorLabelErro;
			document.getElementById("Txtcodrep").style.background = CorCampoErro;
			document.getElementById("Txtcodrep").style.border = BordaCampoErro;
			d.Txtcodrep.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("Txtcodrep").style.background = CorCampoOK;
			document.getElementById("Txtcodrep").style.border = BordaCampoOK;
			document.getElementById("Lblcodrep").style.color = CorLabelOK;
		}
			
		}
		
		if(document.getElementById("HdnValor").value <= 0)
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("LblProcSelecao1").style.color = CorLabelErro;
			document.getElementById("ChkProcSelecao1").style.background = CorCampoErro;
			document.getElementById("ChkProcSelecao1").style.border = BordaCampoErro;
			
			document.getElementById("LblProcSelecao2").style.color = CorLabelErro;
			document.getElementById("ChkProcSelecao2").style.background = CorCampoErro;
			document.getElementById("ChkProcSelecao2").style.border = BordaCampoErro;
			
			document.getElementById("LblProcSelecao3").style.color = CorLabelErro;
			document.getElementById("ChkProcSelecao3").style.background = CorCampoErro;
			document.getElementById("ChkProcSelecao3").style.border = BordaCampoErro;
			
			document.getElementById("LblProcSelecao4").style.color = CorLabelErro;
			document.getElementById("ChkProcSelecao4").style.background = CorCampoErro;
			document.getElementById("ChkProcSelecao4").style.border = BordaCampoErro;
			
			document.getElementById("LblProcSelecao5").style.color = CorLabelErro;
			document.getElementById("ChkProcSelecao5").style.background = CorCampoErro;
			document.getElementById("ChkProcSelecao5").style.border = BordaCampoErro;
			
			document.getElementById("LblProcSelecao6").style.color = CorLabelErro;
			document.getElementById("ChkProcSelecao6").style.background = CorCampoErro;
			document.getElementById("ChkProcSelecao6").style.border = BordaCampoErro;
			
			document.getElementById("LblProcSelecao7").style.color = CorLabelErro;
			document.getElementById("ChkProcSelecao7").style.background = CorCampoErro;
			document.getElementById("ChkProcSelecao7").style.border = BordaCampoErro;
			
			document.getElementById("LblProcSelecao8").style.color = CorLabelErro;
			document.getElementById("ChkProcSelecao8").style.background = CorCampoErro;
			document.getElementById("ChkProcSelecao8").style.border = BordaCampoErro;
			
			document.getElementById("LblProcSelecao9").style.color = CorLabelErro;
			document.getElementById("ChkProcSelecao9").style.background = CorCampoErro;
			document.getElementById("ChkProcSelecao9").style.border = BordaCampoErro;
			
			document.getElementById("LblProcSelecao10").style.color = CorLabelErro;
			document.getElementById("ChkProcSelecao10").style.background = CorCampoErro;
			document.getElementById("ChkProcSelecao10").style.border = BordaCampoErro;
			
			document.getElementById("LblProcSelecao11").style.color = CorLabelErro;
			document.getElementById("ChkProcSelecao11").style.background = CorCampoErro;
			document.getElementById("ChkProcSelecao11").style.border = BordaCampoErro;
			
			document.getElementById("LblProcSelecao12").style.color = CorLabelErro;
			document.getElementById("ChkProcSelecao12").style.background = CorCampoErro;
			document.getElementById("ChkProcSelecao12").style.border = BordaCampoErro;
			
			document.getElementById("LblSelProcSelecao").style.color = CorLabelErro;
			
			//d.TxtEmail.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("LblProcSelecao1").style.color = CorLabelOK;
			document.getElementById("ChkProcSelecao1").style.background = CorCampoOK;
			document.getElementById("ChkProcSelecao1").style.border = BordaCampoOK;
			
			document.getElementById("LblProcSelecao2").style.color = CorLabelOK;
			document.getElementById("ChkProcSelecao2").style.background = CorCampoOK;
			document.getElementById("ChkProcSelecao2").style.border = BordaCampoOK;
			
			document.getElementById("LblProcSelecao3").style.color = CorLabelOK;
			document.getElementById("ChkProcSelecao3").style.background = CorCampoOK;
			document.getElementById("ChkProcSelecao3").style.border = BordaCampoOK;
			
			document.getElementById("LblProcSelecao4").style.color = CorLabelOK;
			document.getElementById("ChkProcSelecao4").style.background = CorCampoOK;
			document.getElementById("ChkProcSelecao4").style.border = BordaCampoOK;
			
			document.getElementById("LblProcSelecao5").style.color = CorLabelOK;
			document.getElementById("ChkProcSelecao5").style.background = CorCampoOK;
			document.getElementById("ChkProcSelecao5").style.border = BordaCampoOK;
			
			document.getElementById("LblProcSelecao6").style.color = CorLabelOK;
			document.getElementById("ChkProcSelecao6").style.background = CorCampoOK;
			document.getElementById("ChkProcSelecao6").style.border = BordaCampoOK;
			
			document.getElementById("LblProcSelecao7").style.color = CorLabelOK;
			document.getElementById("ChkProcSelecao7").style.background = CorCampoOK;
			document.getElementById("ChkProcSelecao7").style.border = BordaCampoOK;
			
			document.getElementById("LblProcSelecao8").style.color = CorLabelOK;
			document.getElementById("ChkProcSelecao8").style.background = CorCampoOK;
			document.getElementById("ChkProcSelecao8").style.border = BordaCampoOK;
			
			document.getElementById("LblProcSelecao9").style.color = CorLabelOK;
			document.getElementById("ChkProcSelecao9").style.background = CorCampoOK;
			document.getElementById("ChkProcSelecao9").style.border = BordaCampoOK;
			
			document.getElementById("LblProcSelecao10").style.color = CorLabelOK;
			document.getElementById("ChkProcSelecao10").style.background = CorCampoOK;
			document.getElementById("ChkProcSelecao10").style.border = BordaCampoOK;
			
			document.getElementById("LblProcSelecao11").style.color = CorLabelOK;
			document.getElementById("ChkProcSelecao11").style.background = CorCampoOK;
			document.getElementById("ChkProcSelecao11").style.border = BordaCampoOK;
			
			document.getElementById("LblProcSelecao12").style.color = CorLabelOK;
			document.getElementById("ChkProcSelecao12").style.background = CorCampoOK;
			document.getElementById("ChkProcSelecao12").style.border = BordaCampoOK;
			
			document.getElementById("LblSelProcSelecao").style.color = CorLabelOK;
			
			
		}
		
		//Valida campo email
		if(d.TxtEmail.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("LblEmail").style.color = CorLabelErro;
			document.getElementById("TxtEmail").style.background = CorCampoErro;
			document.getElementById("TxtEmail").style.border = BordaCampoErro;
			d.TxtEmail.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtEmail").style.background = CorCampoOK;
			document.getElementById("TxtEmail").style.border = BordaCampoOK;
			document.getElementById("LblEmail").style.color = CorLabelOK;
			
		}
		
		//validar email(verificao de endereco eletrônico)
        		 //parte1 = d.TxtEmail.value.indexOf("@"); 
         		 //parte2 = d.TxtEmail.value.indexOf("."); 
         		 //parte3 = d.TxtEmail.value.length;
        		 //if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) 
        		 //{ // Verifica se o @ foi incluído primeiro que o ponto.
                   //alert("O campo " + d.TxtEmail.name + " deve ser conter um endereco eletronico!");
				   //document.getElementById("DvMsgTxtEmail").value = d.TxtEmail.value+" não é um e-mail válido, digite novamente.";
				   //document.getElementById("DvMsgTxtEmail").style.display = "";
                   //d.TxtEmail.focus();
                   //ContaCampos += 1;
                 //}
                 //else
                 //{
                   //document.getElementById("DvMsgTxtEmail").style.display = "none";
			        //document.getElementById("TxtEmail").style.background = CorCampoOK;
			        //document.getElementById("TxtEmail").style.border = BordaCampoOK;
			        //document.getElementById("LblEmail").style.color = CorLabelOK;
			
                 
                 //}
		
		//Valida campo email
		if(d.TxtCPF.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("LblCPF").style.color = CorLabelErro;
			document.getElementById("TxtCPF").style.background = CorCampoErro;
			document.getElementById("TxtCPF").style.border = BordaCampoErro;
			d.TxtCPF.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//alert(vercpf (document.getElementById("TxtCPF").value));
			if(!vercpf (document.getElementById("TxtCPF").value))
			{		
					
					document.getElementById("LblCPF").style.color = CorLabelErro;
					document.getElementById("TxtCPF").style.background = CorCampoErro;
					document.getElementById("TxtCPF").style.border = BordaCampoErro;
					document.getElementById("TxtCPF").value = "";
					d.TxtCPF.focus();
					ContaCampos += 1;
					alert("CPF INVÁLIDO, DIGITE NOVAMNETE");
			}
			else
			{
				//document.getElementById("DvMsgTxtNmCand").style.display = "none";
				document.getElementById("TxtCPF").style.background = CorCampoOK;
				document.getElementById("TxtCPF").style.border = BordaCampoOK;
				document.getElementById("LblCPF").style.color = CorLabelOK;
				
			}
			
		}
		
		//Valida campo data nascimento
		if(d.TxtDtNascimento.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("LblDtNascimento").style.color = CorLabelErro;
			document.getElementById("TxtDtNascimento").style.background = CorCampoErro;
			document.getElementById("TxtDtNascimento").style.border = BordaCampoErro;
			d.TxtDtNascimento.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtDtNascimento").style.background = CorCampoOK;
			document.getElementById("TxtDtNascimento").style.border = BordaCampoOK;
			document.getElementById("LblDtNascimento").style.color = CorLabelOK;
			
		}
		
				//Valida campo RG
		if(d.TxtRG.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("LblRG").style.color = CorLabelErro;
			document.getElementById("TxtRG").style.background = CorCampoErro;
			document.getElementById("TxtRG").style.border = BordaCampoErro;
			d.TxtRG.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtRG").style.background = CorCampoOK;
			document.getElementById("TxtRG").style.border = BordaCampoOK;
			document.getElementById("LblRG").style.color = CorLabelOK;
			
		}
		
		//Valida campo Orgão Expeditor
		if(d.TxtOrgaoExp.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("TxtOrgaoExp").style.background = CorCampoErro;
			document.getElementById("TxtOrgaoExp").style.border = BordaCampoErro;
			document.getElementById("LblOrgaoExp").style.color = CorLabelErro;
			d.TxtOrgaoExp.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtOrgaoExp").style.background = CorCampoOK;
			document.getElementById("TxtOrgaoExp").style.border = BordaCampoOK;
			document.getElementById("LblOrgaoExp").style.color = CorLabelOK;
			
		}
		
		//Valida campo estado
		if(d.DdlUFEsp.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("DdlUFEsp").style.background = CorCampoErro;
			document.getElementById("DdlUFEsp").style.border = BordaCampoErro;
			document.getElementById("LblUFEsp").style.color = CorLabelErro;
			d.DdlUFEsp.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("DdlUFEsp").style.background = CorCampoOK;
			document.getElementById("DdlUFEsp").style.border = BordaCampoOK;
			document.getElementById("LblUFEsp").style.color = CorLabelOK;
			
		}
		
		//Valida campo Nome do pais
		if(d.TxtNmPai.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("TxtNmPai").style.background = CorCampoErro;
			document.getElementById("TxtNmPai").style.border = BordaCampoErro;
			document.getElementById("LblNmPai").style.color = CorLabelErro;
			d.TxtNmPai.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtNmPai").style.background = CorCampoOK;
			document.getElementById("TxtNmPai").style.border = BordaCampoOK;
			document.getElementById("LblNmPai").style.color = CorLabelOK;
			
		}
		
		//Valida campo Nome do pais
		if(d.TxtNmMae.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("TxtNmMae").style.background = CorCampoErro;
			document.getElementById("TxtNmMae").style.border = BordaCampoErro;
			document.getElementById("LblNmMae").style.color = CorLabelErro;
			d.TxtNmMae.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtNmMae").style.background = CorCampoOK;
			document.getElementById("TxtNmMae").style.border = BordaCampoOK;
			document.getElementById("LblNmMae").style.color = CorLabelOK;
			
		}
		
		//Valida campo Nome do da Mãe
		if(d.TxtEndereco.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("TxtEndereco").style.background = CorCampoErro;
			document.getElementById("TxtEndereco").style.border = BordaCampoErro;
			document.getElementById("lblEndereco").style.color = CorLabelErro;
			d.TxtEndereco.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtEndereco").style.background = "#FFF";
			document.getElementById("TxtEndereco").style.border = BordaCampoOK;
			document.getElementById("lblEndereco").style.color = CorLabelOK;
			
		}
		
		
		//Valida campo Número do endereço
		if(d.TxtNr.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("TxtNr").style.background = CorCampoErro;
			document.getElementById("TxtNr").style.border = BordaCampoErro;
			document.getElementById("LblNr").style.color = CorLabelErro;
			d.TxtNr.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtNr").style.background = "#FFF";
			document.getElementById("TxtNr").style.border = BordaCampoOK;
			document.getElementById("LblNr").style.color = CorLabelOK;
			
		}
		
		//Valida campo complemento
		
		//if(d.TxtComlemento.value == "")
		//{
			//document.getElementById("TxtComlemento").style.background = CorCampoErro;
			//document.getElementById("TxtComlemento").style.border = BordaCampoErro;
			//document.getElementById("LblComlemento").style.color = CorLabelErro;
			//d.TxtComlemento.focus();
			//ContaCampos += 1;
		
		//}
		//else
		//{
			//document.getElementById("TxtComlemento").style.background = "#FFF";
			//document.getElementById("TxtComlemento").style.border = BordaCampoOK;
			//document.getElementById("LblComlemento").style.color = CorLabelOK;
			
		//}
		
		//Valida campo Bairro
		if(d.TxtBairro.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("TxtBairro").style.background = CorCampoErro;
			document.getElementById("TxtBairro").style.border = BordaCampoErro;
			document.getElementById("LblBairro").style.color = CorLabelErro;
			d.TxtBairro.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtBairro").style.background = "#FFF";
			document.getElementById("TxtBairro").style.border = BordaCampoOK;
			document.getElementById("LblBairro").style.color = CorLabelOK;
			
		}
		
		//Valida campo Cidade
		if(d.TxtCidade.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("TxtCidade").style.background = CorCampoErro;
			document.getElementById("TxtCidade").style.border = BordaCampoErro;
			document.getElementById("LblCidade").style.color = CorLabelErro;
			d.TxtCidade.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtCidade").style.background = "#FFF";
			document.getElementById("TxtCidade").style.border = BordaCampoOK;
			document.getElementById("LblCidade").style.color = CorLabelOK;
			
		}
		
		//Valida campo Orgão Expeditor
		if(d.DdlUF.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("DdlUF").style.background = CorCampoErro;
			document.getElementById("DdlUF").style.border = BordaCampoErro;
			document.getElementById("LblUF").style.color = CorLabelErro;
			d.DdlUF.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("DdlUF").style.background = "#FFF";
			document.getElementById("DdlUF").style.border = BordaCampoOK;
			document.getElementById("LblUF").style.color = CorLabelOK;
			
		}
		
		//Valida o campo CEP
		if(d.TxtCEP.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("TxtCEP").style.background = CorCampoErro;
			document.getElementById("TxtCEP").style.border = BordaCampoErro;
			document.getElementById("LblCEP").style.color = CorLabelErro;
			d.TxtCEP.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtCEP").style.background = "#FFF";
			document.getElementById("TxtCEP").style.border = BordaCampoOK;
			document.getElementById("LblCEP").style.color = CorLabelOK;
			
		}
		
		//Valida o campo Telefone residencial
		if(d.TxtTelRes.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("TxtTelRes").style.background = CorCampoErro;
			document.getElementById("TxtTelRes").style.border = BordaCampoErro;
			document.getElementById("LblTelRes").style.color = CorLabelErro;
			d.TxtTelRes.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtTelRes").style.background = CorCampoOK;
			document.getElementById("TxtTelRes").style.border = BordaCampoOK;
			document.getElementById("LblTelRes").style.color = CorLabelOK;
			
		}
		
		if(d.DdlCurso1.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("DdlCurso1").style.background = CorCampoErro;
			document.getElementById("DdlCurso1").style.border = BordaCampoErro;
			document.getElementById("LblCurso1").style.color = CorLabelErro;
			d.DdlCurso1.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("DdlCurso1").style.background = CorCampoOK;
			document.getElementById("DdlCurso1").style.border = BordaCampoOK;
			document.getElementById("LblCurso1").style.color = CorLabelOK;
			
		}
		
				if(d.DdlCurso2.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("DdlCurso2").style.background = CorCampoErro;
			document.getElementById("DdlCurso2").style.border = BordaCampoErro;
			document.getElementById("LblCurso2").style.color = CorLabelErro;
			d.DdlCurso2.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("DdlCurso2").style.background = CorCampoOK;
			document.getElementById("DdlCurso2").style.border = BordaCampoOK;
			document.getElementById("LblCurso2").style.color = CorLabelOK;
			
		}
		
		
		//Valida campo Estado Civil
		if(d.DdlEstCivil.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("DdlEstCivil").style.background = CorCampoErro;
			document.getElementById("DdlEstCivil").style.border = BordaCampoErro;
			document.getElementById("LblEstCivil").style.color = CorLabelErro;
			d.DdlEstCivil.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("DdlEstCivil").style.background = "#FFF";
			document.getElementById("DdlEstCivil").style.border = BordaCampoOK;
			document.getElementById("LblEstCivil").style.color = CorLabelOK;
			
		}
		
		//Valida campo nonme
		if(d.TxtNmCandidato.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("LblNmCandidato").style.color = CorLabelErro;
			document.getElementById("TxtNmCandidato").style.background = CorCampoErro;
			document.getElementById("TxtNmCandidato").style.border = BordaCampoErro;
			d.TxtNmCandidato.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "none";
			document.getElementById("TxtNmCandidato").style.background = "#FFF";
			document.getElementById("TxtNmCandidato").style.border = BordaCampoOK;
			document.getElementById("LblNmCandidato").style.color = CorLabelOK;
			
		}
		
		
		
		//Verifica quantidade de campo que são obrigatório e vazios
		if(ContaCampos>0)
		{
			return false;
		}
		else
		{
			return true;
			 
 
			//window.open('../boleto/gerar_boleto2.asp',"janela", "status=no,width=550, height=800")

		}
	
	}
	
	function Numeros(){
		
	tecla = event.keyCode;
	if (tecla >= 48 && tecla <= 57)
		{
			document.getElementById("DvMsgCPF").style.display = "none";
			//document.getElementById("DvMsgRG").style.display = "none";
			
			return true;
		}
	else
		{
			document.getElementById("DvMsgCPF").style.display = "block";
			//document.getElementById("DvMsgRG").style.display = "block";
			
			
			return false;
		}
  }
	
	//INICIO DA FUNÇÃO QUE PREENCHE O CEP CORRETAMENTE
function PreencheCep(){
	campo =document.Inscricao.TxtCEP.value;
	num=0;
	tecla = event.keyCode;
	if (tecla >= 48 && tecla <= 57)
		{
		for(i=0;i<8;i++){
			if(num == 5 && campo.length == 5){
				document.Inscricao.TxtCEP.value+="-";
			}
		
			num++;
		}
		//if(campo.length==9){
		//document.Inscricao.TxtTelRes.focus();
		//}
	
	return true;
	}
	else
	{
		return false;	
	}
}

//INICIO DA FUNÇÃO QUE PREENCHE OS TELEFONES CORRETAMENTE
function PreencheTel(campo, valor){
	//campo =document.Inscricao.TxtCEP.value;
	num=0;
	tecla = event.keyCode;
	
	if (tecla >= 48 && tecla <= 57)
		{
		for(i=1;i<13;i++){
			if(num == 0 && valor.length == 0){
				if(campo == "TxtTelRes")
				{
					document.Inscricao.TxtTelRes.value+="(";
				}
				else
				{
					document.Inscricao.TxtTelCel.value+="(";
				}
			}
			if(num == 4 && valor.length == 3){
				if(campo == "TxtTelRes")
				{
					document.Inscricao.TxtTelRes.value+=")";
				}
				else
				{
					document.Inscricao.TxtTelCel.value+=")";
				}
			}	
			if(num == 9 && valor.length == 8){
				if(campo == "TxtTelRes")
				{
					document.Inscricao.TxtTelRes.value+="-";
					//document.Inscricao.TxtTelCom.focus();
				}
				else
				{
					document.Inscricao.TxtTelCel.value+="-";
					//document.Inscricao.DdlEstCivil.focus();
				}
			}
			if(valor.length>12){
			if(campo == "TxtTelRes")
			{
				document.Inscricao.TxtTelCom.focus();
			}
			else
			{
				document.Inscricao.DdlEstCivil.focus();
			}
			
			}
			
			num++;
		}
		//if(valor.length>12){
			//if(campo == "TxtTelRes")
			//{
				//document.Inscricao.TxtTelCom.focus();
			//}
			//else
			//{
				//document.Inscricao.DdlEstCivil.focus();
			//}
			
		//}
	
	return true;
	}
	else
	{
		return false;	
	}
}

function PreencheData(){
	campo =document.Inscricao.TxtDtNascimento.value;
	//campo =document.getElementById("TxtDtNascimento").value;
	
	num=0;
	
	tecla = event.keyCode;
	if (tecla >= 48 && tecla <= 57)
	{
	for(i=0;i<10;i++){
		if((num == 2 && campo.length == 2) ||(num == 5 && campo.length == 5)){
			document.Inscricao.TxtDtNascimento.value+="/";
		}
		
		num++;
	}
	if(campo.length==10){
		document.Inscricao.TxtRG.focus();
	}
	
	return true;
	}
	else
	{
		return false;	
	}
}

function SelecionaProcSelSN(valor)
{
	if(valor == "SIM")
	{
		//alert("alvaro");
		document.getElementById("TxtQualProcSel").style.display = "";
	}
	else
	{
		document.getElementById("TxtQualProcSel").style.display = "none";
		document.Inscricao.TxtQualProcSel.value = "";
		document.getElementById("TxtQualProcSel").value = "";
		
	}
}

function SelCandTrabalha(valor)
{
	if(valor == "SIM")
	{
		//alert("alvaro");
		document.getElementById("DvTxtProfissao").style.display = "";
	}
	else
	{
		document.getElementById("DvTxtProfissao").style.display = "none";
		document.Inscricao.TxtProfissao.value = "";
		
	}
}

function SelCandDef(valor)
{
	if(valor == "SIM")
	{
		//alert("alvaro");
		document.getElementById("DvTxtDef").style.display = "";
	}
	else
	{
		document.getElementById("DvTxtDef").style.display = "none";
		//document.inscricao.TxtDef.value = "";
	}
}

function ValidaProcSelVl(valor)
{
	//alert(valor);
	if(valor != "")
	{
		//alert(valor);
		document.Inscricao.HdnValor.value += 1;
	}
	else
	{
		document.Inscricao.HdnValor.value = document.Inscricao.HdnValor.value - 1;	
	}
}

function link(end)
{ 
window.open(end,"janela", "status=no,width=350, height=200")
}

function ValidaCampoBoleto()
	{	
	//alert("alvaro");
		d = document.FrmSVBoleto;
		ContaCampos = 0;
		
		//Cores com campo vazios ou inválidos
		CorLabelErro = "#FF0000";
		CorCampoErro = "#FFCC99";
		BordaCampoErro = "solid 1px #FF0000";
		
		//Cor padrão campos
		CorLabelOK = "#006699";
		CorCampoOK = "#FFF";
		BordaCampoOK = "solid 1px #006699";
		//alert("Alvaro");
		
		
				//Valida campo email
		if(d.TxtCPF.value == "")
		{
			//document.getElementById("DvMsgTxtNmCand").style.display = "";
			document.getElementById("LblCPF").style.color = CorLabelErro;
			document.getElementById("TxtCPF").style.background = CorCampoErro;
			document.getElementById("TxtCPF").style.border = BordaCampoErro;
			d.TxtCPF.focus();
			ContaCampos += 1;
		
		}
		else
		{
			//alert(vercpf (document.getElementById("TxtCPF").value));
			if(!vercpf (document.getElementById("TxtCPF").value))
			{		
					
					document.getElementById("LblCPF").style.color = CorLabelErro;
					document.getElementById("TxtCPF").style.background = CorCampoErro;
					document.getElementById("TxtCPF").style.border = BordaCampoErro;
					document.getElementById("TxtCPF").value = "";
					d.TxtCPF.focus();
					ContaCampos += 1;
					//alert("CPF INVÁLIDO, DIGITE NOVAMENTE");
					document.getElementById("DvMsgCPFInvalido").style.display ="";
			}
			else
			{
				//document.getElementById("DvMsgTxtNmCand").style.display = "none";
				document.getElementById("TxtCPF").style.background = CorCampoOK;
				document.getElementById("TxtCPF").style.border = BordaCampoOK;
				document.getElementById("LblCPF").style.color = CorLabelOK;
				document.getElementById("DvMsgCPFInvalido").style.display ="none";
				
			}
			
		}

		//Verifica quantidade de campo que são obrigatório e vazios
		if(ContaCampos>0)
		{
			return false;
		}
		else
		{
			return true;
			 
 
			
		}
}

	function NumerosPopup(){
		
	tecla = event.keyCode;
	if (tecla >= 48 && tecla <= 57)
		{
			document.getElementById("DvMsgCPFPopup").style.display = "none";
			
			return true;
		}
	else
		{
			document.getElementById("DvMsgCPFPopup").style.display = "block";
			
			return false;
		}
  }

	
	
	function JanelaSVBoleto(valor)
	{
		//alert("Alvaro");
		window.location.href = valor;
	}

