﻿function Init()
{
try
{
try
{
if (document.getElementById("lblEtapaDescricao").innerHTML.toUpperCase().indexOf("<BR>") == -1)
{
scrollTo(0,document.getElementById("BodyPosition").value);
}
}
catch (e) {}
if (document.getElementById("rdbPassaporte").checked)
{
document.getElementById("pais").style.display = "block";
}
if(document.getElementById("chkDeficiencia").checked)
{
document.getElementById("idDeficiencia").style.display = "block"
}
document.getElementById("token").value = strTemp;
document.getElementById("code").value = strTmp;
document.getElementById("txtCodigoPostal").value = document.getElementById("txtCep").value;
InitDDL();
}
catch (e) {}
}
function AtualizaPosicao()
{
try
{
document.getElementById("BodyPosition").value = document.getElementById("Body").scrollTop;
}
catch (e) {}
}
function ExibirPais(obj)
{
if (obj.value == "rdbCPF")
{
pais.style.display = "none";
}
else
{
pais.style.display = "block";
}
Form1.txtPessoaCodigo.value = "";
}
function MascaraCPF(obj,chk)
{
if (chk)
{
obj.maxLength = 14;
campo = obj.value;
if (campo.length == 3)
{
obj.value = campo + ".";
}
else if (campo.length == 7)
{
obj.value = campo + ".";
}
else if (campo.length == 11)
{
obj.value = campo + "-";
}
}
}
function MascaraData(obj)
{
campo = obj.value;
if (campo.length == 2)
{
obj.value = campo + "/";
}
else if (campo.length == 5)
{
obj.value = campo + "/";
}
}
function MascaraCEP(obj,chk)
{
if (chk)
{
campo = obj.value;
if (campo.length == 2)
{
obj.value = campo + ".";
}
else if (campo.length == 6)
{
obj.value = campo + "-";
}
}
}
function SaveName(objddl,strtxt)
{
objtxt = document.getElementById(strtxt);
objtxt.value = objddl.options[objddl.selectedIndex].text;
}
function ChangeValue(objddl,strtxt)
{
objtxt = document.getElementById(strtxt);
objtxt.value = objddl.options[objddl.selectedIndex].value;
}
function InitDDL()
{
objtxtHasError = document.getElementById("txtHasError");
if (objtxtHasError.value=="true")
{
return;
}
strSrcImgPx = document.getElementById("txtSkin").value + "gif/pub_separator_px.gif";
try{document.getElementById("BotaoAnterior").src = strSrcImgPx;}catch(e){}
try{document.getElementById("BotaoSalvar").src = strSrcImgPx;}catch(e){}
try{document.getElementById("BotaoProxima").src = strSrcImgPx;}catch(e){}
try
{
strSufixo = document.getElementById("txtDataCache").value;
includeHTML("tdSourceddlPais",location.href.substring(0,location.href.indexOf("/pub/"))+"/website/software/cache/cachePais"+strSufixo+".html");
includeHTML("tdSourceddlPerguntaSecreta",location.href.substring(0,location.href.indexOf("/pub/"))+"/website/software/cache/cachePerguntaSecreta"+strSufixo+".html");
includeHTML("tdSourceddlEstadoCivil",location.href.substring(0,location.href.indexOf("/pub/"))+"/website/software/cache/cacheEstadoCivil"+strSufixo+".html");
includeHTML("tdSourceddlReligiao",location.href.substring(0,location.href.indexOf("/pub/"))+"/website/software/cache/cacheReligiao"+strSufixo+".html");
includeHTML("tdSourceddlDeficienciaGrupo",location.href.substring(0,location.href.indexOf("/pub/"))+"/website/software/cache/cacheDeficienciaGrupo"+strSufixo+".html");
includeHTML("tdSourceddlEstado",location.href.substring(0,location.href.indexOf("/pub/"))+"/website/software/cache/cacheEstado"+strSufixo+".html");
includeHTML("tdSourceddlTelefoneTipo",location.href.substring(0,location.href.indexOf("/pub/"))+"/website/software/cache/cacheTipoTelefone"+strSufixo+".html");
objSourceddlPais = document.getElementById("SourceddlPais");
objddlPaisPassaporte = document.getElementById("ddlPaisPassaporte");
objddlInformacoesNacionalidade = document.getElementById("ddlInformacoesNacionalidade");
objddlEnderecoPais = document.getElementById("ddlEnderecoPais");
objtxtPaisPassaporte = document.getElementById("txtPaisPassaporte");
objtxtInformacoesNacionalidade = document.getElementById("txtInformacoesNacionalidade");
objtxtEnderecoPais = document.getElementById("txtEnderecoPais");
for (i=0; i<objSourceddlPais.length; i++)
{
objddlPaisPassaporte.options[i] = new Option(objSourceddlPais.options[i].text,objSourceddlPais.options[i].value);
if (objddlPaisPassaporte.options[i].value == objtxtPaisPassaporte.value)
{
objddlPaisPassaporte.selectedIndex = i;
}
objddlInformacoesNacionalidade.options[i] = new Option(objSourceddlPais.options[i].text,objSourceddlPais.options[i].text);
if (objddlInformacoesNacionalidade.options[i].value == objtxtInformacoesNacionalidade.value)
{
objddlInformacoesNacionalidade.selectedIndex = i;
}
objddlEnderecoPais.options[i] = new Option(objSourceddlPais.options[i].text,objSourceddlPais.options[i].text);
if (objddlEnderecoPais.options[i].value == objtxtEnderecoPais.value)
{
objddlEnderecoPais.selectedIndex = i;
}
}
objSourceddlPerguntaSecreta = document.getElementById("SourceddlPerguntaSecreta");
objddlPerguntaSecreta = document.getElementById("ddlPerguntaSecreta");
objtxtPerguntaSecreta = document.getElementById("txtPerguntaSecreta");
for (i=0; i<objSourceddlPerguntaSecreta.length; i++)
{
objddlPerguntaSecreta.options[i] = new Option(objSourceddlPerguntaSecreta.options[i].text,objSourceddlPerguntaSecreta.options[i].value);
if (objddlPerguntaSecreta.options[i].value == objtxtPerguntaSecreta.value)
{
objddlPerguntaSecreta.selectedIndex = i;
}
}
objSourceddlEstadoCivil = document.getElementById("SourceddlEstadoCivil");
objddlEstadoCivil = document.getElementById("ddlEstadoCivil");
objtxtEstadoCivil = document.getElementById("txtEstadoCivil");
for (i=0; i<objSourceddlEstadoCivil.length; i++)
{
objddlEstadoCivil.options[i] = new Option(objSourceddlEstadoCivil.options[i].text,objSourceddlEstadoCivil.options[i].value);
if (objddlEstadoCivil.options[i].value == objtxtEstadoCivil.value)
{
objddlEstadoCivil.selectedIndex = i;
}
}
objSourceddlReligiao = document.getElementById("SourceddlReligiao");
objddlReligiao = document.getElementById("ddlReligiao");
objtxtReligiao = document.getElementById("txtReligiao");
for (i=0; i<objSourceddlReligiao.length; i++)
{
objddlReligiao.options[i] = new Option(objSourceddlReligiao.options[i].text,objSourceddlReligiao.options[i].value);
if (objddlReligiao.options[i].value == objtxtReligiao.value)
{
objddlReligiao.selectedIndex = i;
}
}
objSourceddlDeficienciaGrupo = document.getElementById("SourceddlDeficienciaGrupo");
objddlDeficienciaGrupo = document.getElementById("ddlDeficienciaGrupo");
objtxtDeficienciaGrupo = document.getElementById("txtDeficienciaGrupo");
for (i=0; i<objSourceddlDeficienciaGrupo.length; i++)
{
objddlDeficienciaGrupo.options[i] = new Option(objSourceddlDeficienciaGrupo.options[i].text,objSourceddlDeficienciaGrupo.options[i].value);
if (objddlDeficienciaGrupo.options[i].value == objtxtDeficienciaGrupo.value)
{
objddlDeficienciaGrupo.selectedIndex = i;
}
}
objSourceddlEstado = document.getElementById("SourceddlEstado");
objddlEnderecoEstado = document.getElementById("ddlEnderecoEstado");
objtxtEnderecoEstado = document.getElementById("txtEnderecoEstado");
objtxtEnderecoEstadoNome = document.getElementById("txtEnderecoEstadoNome");
for (i=0; i<objSourceddlEstado.length; i++)
{
objddlEnderecoEstado.options[i] = new Option(objSourceddlEstado.options[i].text,objSourceddlEstado.options[i].value);
if (objddlEnderecoEstado.options[i].value == objtxtEnderecoEstado.value)
{
objddlEnderecoEstado.selectedIndex = i;
objtxtEnderecoEstadoNome.value = objddlEnderecoEstado.options[i].text
}
}
objSourceddlTelefoneTipo = document.getElementById("SourceddlTelefoneTipo");
objddlTelefoneTipo1 = document.getElementById("ddlTelefoneTipo1");
objddlTelefoneTipo2 = document.getElementById("ddlTelefoneTipo2");
objddlTelefoneTipo3 = document.getElementById("ddlTelefoneTipo3");
objddlTelefoneTipo4 = document.getElementById("ddlTelefoneTipo4");
objtxtTelefoneTipo1 = document.getElementById("txtTelefoneTipo1");
objtxtTelefoneTipo2 = document.getElementById("txtTelefoneTipo2");
objtxtTelefoneTipo3 = document.getElementById("txtTelefoneTipo3");
objtxtTelefoneTipo4 = document.getElementById("txtTelefoneTipo4");
for (i=0; i<objSourceddlTelefoneTipo.length; i++)
{
objddlTelefoneTipo1.options[i] = new Option(objSourceddlTelefoneTipo.options[i].text,objSourceddlTelefoneTipo.options[i].value);
if (objddlTelefoneTipo1.options[i].value == objtxtTelefoneTipo1.value)
{
objddlTelefoneTipo1.selectedIndex = i;
}
objddlTelefoneTipo2.options[i] = new Option(objSourceddlTelefoneTipo.options[i].text,objSourceddlTelefoneTipo.options[i].value);
if (objddlTelefoneTipo2.options[i].value == objtxtTelefoneTipo2.value)
{
objddlTelefoneTipo2.selectedIndex = i;
}
objddlTelefoneTipo3.options[i] = new Option(objSourceddlTelefoneTipo.options[i].text,objSourceddlTelefoneTipo.options[i].value);
if (objddlTelefoneTipo3.options[i].value == objtxtTelefoneTipo3.value)
{
objddlTelefoneTipo3.selectedIndex = i;
}
objddlTelefoneTipo4.options[i] = new Option(objSourceddlTelefoneTipo.options[i].text,objSourceddlTelefoneTipo.options[i].value);
if (objddlTelefoneTipo4.options[i].value == objtxtTelefoneTipo4.value)
{
objddlTelefoneTipo4.selectedIndex = i;
}
}
}
catch(e){}
}
function ltrim(str)
{
for (var i = 0; (i < str.length) && (str.charAt(i) == " "); i++)
{
}
if (i == str.length)
{
return "";
}
else
{
return str.substring(i, str.length);
}
}
function rtrim(str)
{
for (var i = str.length; (i > 0) && (str.charAt(i - 1) == " "); i--)
{
}
return str.substring(0, i);
}
function trim(str)
{
for (var i = 0; (i < str.length) && (str.charAt(i) == " "); i++)
{
}
for (var j = str.length; (j > 0) && (str.charAt(j - 1) == " "); j--)
{
}
if (i == str.length)
{
return "";
}
else
{
return str.substring(i, j);
}
}
function alltrim(str)
{
for (var i = 0; (i < str.length) && (str.charAt(i) == " "); i++)
{
}
for (var j = str.length; (j > 0) && (str.charAt(j - 1) == " "); j--)
{
}
if (i == str.length)
{
str = "";
}
else
{
str = str.substring(i, j);
}
while (str.length > 0 && str.indexOf("\t") != -1)
{
str = str.substring(0,str.indexOf("\t")) + str.substring(str.indexOf("\t")+1,str.length)
}
return str;
}
function validarCPF(pCPF)
{
try
{
strCPF = pCPF.replace(".","").replace(".","").replace("-","");
if (strCPF.length != 11 || isNaN(strCPF) || strCPF.indexOf(",") != -1 || strCPF.indexOf(".") != -1 || strCPF.indexOf("-") != -1) //if (strCPF.length != 11 || isNaN(strCPF) || strCPF.indexOf(",") != -1 || pCPF.charAt(3) != "." || pCPF.charAt(7) != "." || pCPF.charAt(11) != "-" || pCPF.indexOf(".") != 3 || pCPF.lastIndexOf(".") != 7 || pCPF.indexOf(".",4) != 7 || pCPF.indexOf("-") != 11 || pCPF.lastIndexOf("-") != 11)
{
return false;
}
firstSum = 0;
firstDigit = 0;
for (var i = 0; i <= 8; i++)
{
firstSum += parseInt(strCPF.substring(i,i+1))*(10 - i);
}
firstRemResult = firstSum % 11;
if (firstRemResult > 1)
{
firstDigit = 11 - firstRemResult;
}
if (parseInt(strCPF.substring(9,10)) != firstDigit)
{
return false;
}
secondSum = 0;
secondDigit = 0;
for (var i = 0; i <= 9; i++)
{
secondSum += parseInt(strCPF.substring(i,i+1))*(11 - i);
}
secondRemResult = secondSum % 11;
if (secondRemResult > 1)
{
secondDigit = 11 - secondRemResult;
}
if (parseInt(strCPF.substring(10,11)) != secondDigit)
{
return false;
}
return true;
}
catch (e)
{
return false;
}
}
function validarEmail(pEmail)
{
try
{
if ((pEmail.indexOf(" ") != -1) || //contém espaços em branco
(pEmail.length < 5) || //tamanho menor que 5
(pEmail.indexOf("@") == -1) || //não tem @
(pEmail.indexOf("@") != pEmail.lastIndexOf("@")) || //tem mais de 1 @
(pEmail.indexOf("@") == 0) || //começa com @
(pEmail.indexOf("@") == pEmail.length-1) || //termina com @
(pEmail.indexOf(".") == 0) || //começa com .
(pEmail.lastIndexOf(".") == pEmail.length-1) || //termina com .
(pEmail.charAt(pEmail.indexOf("@")-1) == ".") || // . seguido de @
(pEmail.charAt(pEmail.indexOf("@")+1) == ".") || // @ seguido de .
(pEmail.indexOf("@") > pEmail.lastIndexOf("."))) //não tem . após @
{
return false;
}
return true;
}
catch (e)
{
return false;
}
}
function cvDadosPessoais_ClientValidate()
{
objrdbCPF = document.getElementById("rdbCPF");
objrdbPassaporte = document.getElementById("rdbPassaporte");
objtxtPessoaCodigo = document.getElementById("txtPessoaCodigo");
objtxtPaisPassaporte = document.getElementById("txtPaisPassaporte");
objtxtNome = document.getElementById("txtNome");
objtxtSenha = document.getElementById("txtSenha");
objtxtSenhaConfirmar = document.getElementById("txtSenhaConfirmar");
objtxtPerguntaSecreta = document.getElementById("txtPerguntaSecreta");
objtxtResposta = document.getElementById("txtResposta");
objtxtDataNascimento = document.getElementById("txtDataNascimento");
objrdbSexoMasculino = document.getElementById("rdbSexoMasculino");
objrdbSexoFeminino = document.getElementById("rdbSexoFeminino");
objtxtCep = document.getElementById("txtCep");
objtxtLogradouro = document.getElementById("txtLogradouro");
objtxtComplemento = document.getElementById("txtComplemento");
objtxtBairro = document.getElementById("txtBairro");
objtxtCidade = document.getElementById("txtCidade");
objtxtEnderecoEstado = document.getElementById("txtEnderecoEstado");
objtxtEnderecoPais = document.getElementById("txtEnderecoPais");
objtxtIndEmailObrigatorio = (document.getElementById("tdIndEmailObrig").innerHTML == "*" ? true : false);
objtxtEmail = document.getElementById("txtEmail");
objtxtEmailConfirmar = document.getElementById("txtEmailConfirmar");
objtxtTelefoneTipo1 = document.getElementById("txtTelefoneTipo1");
objtxtTelefone1 = document.getElementById("txtTelefone1");
objchkDeficiencia = document.getElementById("chkDeficiencia");
objtxtDeficienciaGrupo = document.getElementById("txtDeficienciaGrupo");
objtxtDependentes = document.getElementById("txtDependentes");
objlblIdentificacao_Pais = document.getElementById("lblIdentificacao_Pais");
objlblIdentificacao_NumeroDocumento = document.getElementById("lblIdentificacao_NumeroDocumento");
objlblIdentificacao_NomeCompleto = document.getElementById("lblIdentificacao_NomeCompleto");
objlblIdentificacao_Senha = document.getElementById("lblIdentificacao_Senha");
objlblIdentificacao_ConfirmarSenha = document.getElementById("lblIdentificacao_ConfirmarSenha");
objlblIdentificacao_PerguntaSecreta = document.getElementById("lblIdentificacao_PerguntaSecreta");
objlblIdentificacao_Resposta = document.getElementById("lblIdentificacao_Resposta");
objlblInformacoes_Sexo = document.getElementById("lblInformacoes_Sexo");
objlblInformacoes_DataNascimento = document.getElementById("lblInformacoes_DataNascimento");
objlblInformacoes_Dependentes = document.getElementById("lblInformacoes_Dependentes");
objlblEndereco_Cep = document.getElementById("lblEndereco_Cep");
objlblEndereco_Logradouro = document.getElementById("lblEndereco_Logradouro");
objlblEndereco_Complemento = document.getElementById("lblEndereco_Complemento");
objlblEndereco_Bairro = document.getElementById("lblEndereco_Bairro");
objlblEndereco_Cidade = document.getElementById("lblEndereco_Cidade");
objlblEndereco_Estado = document.getElementById("lblEndereco_Estado");
objlblEndereco_Pais = document.getElementById("lblEndereco_Pais");
objlblContato_Email = document.getElementById("lblContato_Email");
objlblContato_EmailConfirmar = document.getElementById("lblContato_EmailConfirmar");
objlblContato_Telefone1 = document.getElementById("lblContato_Telefone1");
objlblDeficienciaGrupo = document.getElementById("lblDeficienciaGrupo");
objimgIdentificacaoErro_Pais = document.getElementById("imgIdentificacaoErro_Pais");
objimgIdentificacaoErro_NumeroDocumento = document.getElementById("imgIdentificacaoErro_NumeroDocumento");
objimgIdentificacaoErro_NomeCompleto = document.getElementById("imgIdentificacaoErro_NomeCompleto");
objimgIdentificacaoErro_Senha = document.getElementById("imgIdentificacaoErro_Senha");
objimgIdentificacaoErro_ConfirmarSenha = document.getElementById("imgIdentificacaoErro_ConfirmarSenha");
objimgIdentificacaoErro_PerguntaSecreta = document.getElementById("imgIdentificacaoErro_PerguntaSecreta");
objimgIdentificacaoErro_Resposta = document.getElementById("imgIdentificacaoErro_Resposta");
objimgInformacoes_Sexo = document.getElementById("imgInformacoes_Sexo");
objimgInformacoes_DataNascimento = document.getElementById("imgInformacoes_DataNascimento");
objimgInformacoes_Dependentes = document.getElementById("imgInformacoes_Dependentes");
objimgEndereco_Cep = document.getElementById("imgEndereco_Cep");
objimgEndereco_Logradouro = document.getElementById("imgEndereco_Logradouro");
objimgEndereco_Complemento = document.getElementById("imgEndereco_Complemento");
objimgEndereco_Bairro = document.getElementById("imgEndereco_Bairro");
objimgEndereco_Cidade = document.getElementById("imgEndereco_Cidade");
objimgEndereco_Estado = document.getElementById("imgEndereco_Estado");
objimgEndereco_Pais = document.getElementById("imgEndereco_Pais");
objimgContato_Email = document.getElementById("imgContato_Email");
objimgContato_EmailConfirmar = document.getElementById("imgContato_EmailConfirmar");
objimgContato_Telefone1 = document.getElementById("imgContato_Telefone1");
objimgDeficienciaGrupo = document.getElementById("imgDeficienciaGrupo");
objtxtPessoaCodigo.value = alltrim(objtxtPessoaCodigo.value);
objtxtPaisPassaporte.value = alltrim(objtxtPaisPassaporte.value);
objtxtNome.value = alltrim(objtxtNome.value);
objtxtSenha.value = alltrim(objtxtSenha.value);
objtxtSenhaConfirmar.value = alltrim(objtxtSenhaConfirmar.value);
objtxtPerguntaSecreta.value = alltrim(objtxtPerguntaSecreta.value);
objtxtResposta.value = alltrim(objtxtResposta.value);
objtxtDataNascimento.value = alltrim(objtxtDataNascimento.value);
objtxtCep.value = alltrim(objtxtCep.value);
objtxtLogradouro.value = alltrim(objtxtLogradouro.value);
objtxtComplemento.value = alltrim(objtxtComplemento.value);
objtxtBairro.value = alltrim(objtxtBairro.value);
objtxtCidade.value = alltrim(objtxtCidade.value);
objtxtEnderecoEstado.value = alltrim(objtxtEnderecoEstado.value);
objtxtEnderecoPais.value = alltrim(objtxtEnderecoPais.value);
objtxtEmail.value = alltrim(objtxtEmail.value);
objtxtEmailConfirmar.value = alltrim(objtxtEmailConfirmar.value);
objtxtTelefoneTipo1.value = alltrim(objtxtTelefoneTipo1.value);
objtxtTelefone1.value = alltrim(objtxtTelefone1.value);
objtxtDeficienciaGrupo.value = alltrim(objtxtDeficienciaGrupo.value);
objtxtDependentes.value = alltrim(objtxtDependentes.value);
objlblIdentificacao_Pais.style.color = "";
objlblIdentificacao_NumeroDocumento.style.color = "";
objlblIdentificacao_NomeCompleto.style.color = "";
objlblIdentificacao_Senha.style.color = "";
objlblIdentificacao_ConfirmarSenha.style.color = "";
objlblIdentificacao_PerguntaSecreta.style.color = "";
objlblIdentificacao_Resposta.style.color = "";
objlblInformacoes_Sexo.style.color = "";
objlblInformacoes_DataNascimento.style.color = "";
objlblInformacoes_Dependentes.style.color = "";
objlblEndereco_Cep.style.color = "";
objlblEndereco_Logradouro.style.color = "";
objlblEndereco_Complemento.style.color = "";
objlblEndereco_Bairro.style.color = "";
objlblEndereco_Cidade.style.color = "";
objlblEndereco_Estado.style.color = "";
objlblEndereco_Pais.style.color = "";
objlblContato_Email.style.color = "";
objlblContato_EmailConfirmar.style.color = "";
objlblContato_Telefone1.style.color = "";
objlblDeficienciaGrupo.style.color = "";
objimgIdentificacaoErro_Pais.style.display = "none";
objimgIdentificacaoErro_NumeroDocumento.style.display = "none";
objimgIdentificacaoErro_NomeCompleto.style.display = "none";
objimgIdentificacaoErro_Senha.style.display = "none";
objimgIdentificacaoErro_ConfirmarSenha.style.display = "none";
objimgIdentificacaoErro_PerguntaSecreta.style.display = "none";
objimgIdentificacaoErro_Resposta.style.display = "none";
objimgInformacoes_Sexo.style.display = "none";
objimgInformacoes_DataNascimento.style.display = "none";
objimgInformacoes_Dependentes.style.display = "none";
objimgEndereco_Cep.style.display = "none";
objimgEndereco_Logradouro.style.display = "none";
objimgEndereco_Complemento.style.display = "none";
objimgEndereco_Bairro.style.display = "none";
objimgEndereco_Cidade.style.display = "none";
objimgEndereco_Estado.style.display = "none";
objimgEndereco_Pais.style.display = "none";
objimgContato_Email.style.display = "none";
objimgContato_EmailConfirmar.style.display = "none";
objimgContato_Telefone1.style.display = "none";
objimgDeficienciaGrupo.style.display = "none";
objimgIdentificacaoErro_Pais.title = "";
objimgIdentificacaoErro_NumeroDocumento.title = "";
objimgIdentificacaoErro_NomeCompleto.title = "";
objimgIdentificacaoErro_Senha.title = "";
objimgIdentificacaoErro_ConfirmarSenha.title = "";
objimgIdentificacaoErro_PerguntaSecreta.title = "";
objimgIdentificacaoErro_Resposta.title = "";
objimgInformacoes_Sexo.title = "";
objimgInformacoes_DataNascimento.title = "";
objimgInformacoes_Dependentes.title = "";
objimgEndereco_Cep.title = "";
objimgEndereco_Logradouro.title = "";
objimgEndereco_Complemento.title = "";
objimgEndereco_Bairro.title = "";
objimgEndereco_Cidade.title = "";
objimgEndereco_Estado.title = "";
objimgEndereco_Pais.title = "";
objimgContato_Email.title = "";
objimgContato_EmailConfirmar.title = "";
objimgContato_Telefone1.title = "";
objimgDeficienciaGrupo.title = "";
strRtn = true;
if ((objrdbCPF.checked && objtxtPessoaCodigo.value.length == 0) || (objrdbPassaporte.checked && (objtxtPaisPassaporte.value.length == 0 || objtxtPessoaCodigo.value.length == 0)) || objtxtNome.value.length == 0 || objtxtSenha.value.length == 0 || objtxtSenhaConfirmar.value.length == 0 || objtxtPerguntaSecreta.value.length == 0 || objtxtResposta.value.length == 0 || objtxtDataNascimento.value.length == 0 || (!objrdbSexoMasculino.checked && !objrdbSexoFeminino.checked) || objtxtCep.value.length == 0 || objtxtLogradouro.value.length == 0 || objtxtComplemento.value.length == 0 || objtxtBairro.value.length == 0 || objtxtCidade.value.length == 0 || ((objtxtEnderecoEstado.value.length == 0) && ((objtxtEnderecoPais.value.length == 0) || (objtxtEnderecoPais.value == "Brasil")))  || objtxtEnderecoPais.value.length == 0 || ((objtxtEmail.value.length == 0) && objtxtIndEmailObrigatorio) || ((objtxtEmailConfirmar.value.length == 0) && objtxtIndEmailObrigatorio) || objtxtTelefoneTipo1.value == "0"  || objtxtTelefone1.value.length == 0)
{
if (objrdbPassaporte.checked && objtxtPaisPassaporte.value.length == 0)
{
objlblIdentificacao_Pais.style.color = "Red";
objimgIdentificacaoErro_Pais.title = "O campo país é obrigatório quando se seleciona um documento do tipo passaporte."; //GetErroMessage("3")
objimgIdentificacaoErro_Pais.style.display = "";
}
if (objtxtPessoaCodigo.value.length == 0)
{
objlblIdentificacao_NumeroDocumento.style.color = "Red";
objimgIdentificacaoErro_NumeroDocumento.title = "O campo número do documento é obrigatório."; //GetErroMessage("1")
objimgIdentificacaoErro_NumeroDocumento.style.display = "";
}
if (objtxtNome.value.length == 0)
{
objlblIdentificacao_NomeCompleto.style.color = "Red";
objimgIdentificacaoErro_NomeCompleto.title = "O campo nome é obrigatório."; //GetErroMessage("2")
objimgIdentificacaoErro_NomeCompleto.style.display = "";
}
if (objtxtSenha.value.length == 0)
{
objlblIdentificacao_Senha.style.color = "Red";
objimgIdentificacaoErro_Senha.title = "O campo senha é obrigatório."; //GetErroMessage("4")
objimgIdentificacaoErro_Senha.style.display = "";
}
if (objtxtSenhaConfirmar.value.length == 0)
{
objlblIdentificacao_ConfirmarSenha.style.color = "Red";
objimgIdentificacaoErro_ConfirmarSenha.title = "O campo confirmar senha é obrigatório."; //GetErroMessage("5")
objimgIdentificacaoErro_ConfirmarSenha.style.display = "";
}
if (objtxtPerguntaSecreta.value.length == 0)
{
objlblIdentificacao_PerguntaSecreta.style.color = "Red";
objimgIdentificacaoErro_PerguntaSecreta.title = "O campo pergunta secreta é obrigatório."; //GetErroMessage("6")
objimgIdentificacaoErro_PerguntaSecreta.style.display = "";
}
if (objtxtResposta.value.length == 0)
{
objlblIdentificacao_Resposta.style.color = "Red";
objimgIdentificacaoErro_Resposta.title = "O campo resposta é obrigatório."; //GetErroMessage("7")
objimgIdentificacaoErro_Resposta.style.display = "";
}
if (!objrdbSexoMasculino.checked && !objrdbSexoFeminino.checked)
{
objlblInformacoes_Sexo.style.color = "Red";
objimgInformacoes_Sexo.title = "O campo sexo é obrigatório."; //GetErroMessage("14")
objimgInformacoes_Sexo.style.display = "";
}
if (objtxtDataNascimento.value.length == 0)
{
objlblInformacoes_DataNascimento.style.color = "Red";
objimgInformacoes_DataNascimento.title = "O campo data de nascimento é obrigatório."; //GetErroMessage("15")
objimgInformacoes_DataNascimento.style.display = "";
}
if (objtxtCep.value.length == 0)
{
objlblEndereco_Cep.style.color = "Red";
objimgEndereco_Cep.title = "O campo CEP é obrigatório."; //GetErroMessage("17")
objimgEndereco_Cep.style.display = "";
}
if (objtxtLogradouro.value.length == 0)
{
objlblEndereco_Logradouro.style.color = "Red";
objimgEndereco_Logradouro.title = "O campo logradouro é obrigatório."; //GetErroMessage("18")
objimgEndereco_Logradouro.style.display = "";
}
if (objtxtComplemento.value.length == 0)
{
objlblEndereco_Complemento.style.color = "Red";
objimgEndereco_Complemento.title = "O campo complemento é obrigatório."; //GetErroMessage("19")
objimgEndereco_Complemento.style.display = "";
}
if (objtxtBairro.value.length == 0)
{
objlblEndereco_Bairro.style.color = "Red";
objimgEndereco_Bairro.title = "O campo bairro é obrigatório."; //GetErroMessage("20")
objimgEndereco_Bairro.style.display = "";
}
if (objtxtCidade.value.length == 0)
{
objlblEndereco_Cidade.style.color = "Red";
objimgEndereco_Cidade.title = "O campo cidade é obrigatório."; //GetErroMessage("21")
objimgEndereco_Cidade.style.display = "";
}
if (objtxtEnderecoEstado.value.length == 0)
{
if (objtxtEnderecoPais.value.length == 0 || objtxtEnderecoPais.value == "Brasil")
{
objlblEndereco_Estado.style.color = "Red";
objimgEndereco_Estado.title = "O campo estado é obrigatório."; //GetErroMessage("22")
objimgEndereco_Estado.style.display = "";
}
}
if (objtxtEnderecoPais.value.length == 0)
{
objlblEndereco_Pais.style.color = "Red";
objimgEndereco_Pais.title = "O campo país é obrigatório."; //GetErroMessage("23")
objimgEndereco_Pais.style.display = "";
}
if (objtxtIndEmailObrigatorio && objtxtEmail.value.length == 0)
{
objlblContato_Email.style.color = "Red";
objimgContato_Email.title = "O campo e-mail é obrigatório."; //GetErroMessage("24")
objimgContato_Email.style.display = "";
}
if (objtxtIndEmailObrigatorio && objtxtEmailConfirmar.value.length == 0)
{
objlblContato_EmailConfirmar.style.color = "Red";
objimgContato_EmailConfirmar.title = "O campo confirmar e-mail é obrigatório."; //GetErroMessage("25")
objimgContato_EmailConfirmar.style.display = "";
}
if (objtxtTelefoneTipo1.value == "0")
{
objlblContato_Telefone1.style.color = "Red";
objimgContato_Telefone1.title = "O campo tipo de telefone é obrigatório."; //GetErroMessage("26")
objimgContato_Telefone1.style.display = "";
}
else
{
if (objtxtTelefone1.value.length == 0)
{
objlblContato_Telefone1.style.color = "Red";
objimgContato_Telefone1.title = "O campo telefone é obrigatório."; //GetErroMessage("27")
objimgContato_Telefone1.style.display = "";
}
}
strRtn = false;
}
if (objrdbCPF.checked && objtxtPessoaCodigo.value.length > 0 && !validarCPF(objtxtPessoaCodigo.value))
{
objlblIdentificacao_NumeroDocumento.style.color = "Red";
objimgIdentificacaoErro_NumeroDocumento.title = "O campo número do documento é um CPF inválido."; //GetErroMessage("11")
objimgIdentificacaoErro_NumeroDocumento.style.display = "";
strRtn = false;
}
if (objtxtSenha.value.length > 0 && objtxtSenha.value.length < 8 || objtxtSenha.value.length > 12)
{
objlblIdentificacao_Senha.style.color = "Red";
objimgIdentificacaoErro_Senha.title = "O campo senha deve conter de 8 à 12 caracteres, sendo estes letras e/ou números."; //GetErroMessage("9")
objimgIdentificacaoErro_Senha.style.display = "";
strRtn = false;
}
if (objtxtSenha.value != objtxtSenhaConfirmar.value)
{
objlblIdentificacao_ConfirmarSenha.style.color = "Red";
objimgIdentificacaoErro_ConfirmarSenha.title = "O campo confirmar senha deve ser igual ao campo senha."; //GetErroMessage("8")
objimgIdentificacaoErro_ConfirmarSenha.style.display = "";
strRtn = false;
}
if (objtxtEmail.value != "" && !validarEmail(objtxtEmail.value))
{
objlblContato_Email.style.color = "Red";
objimgContato_Email.title = "O campo e-mail é inválido."; //GetErroMessage("28")
objimgContato_Email.style.display = "";
strRtn = false;
}
if (objtxtEmail.value != objtxtEmailConfirmar.value)
{
objlblContato_EmailConfirmar.style.color = "Red";
objimgContato_EmailConfirmar.title = "O campo confirmar e-mail deve ser igual ao campo e-mail."; //GetErroMessage("29")
objimgContato_EmailConfirmar.style.display = "";
strRtn = false;
}
if (objtxtDataNascimento.value.length > 0)
{
if (objtxtDataNascimento.value.length < 10)
{
objlblInformacoes_DataNascimento.style.color = "Red";
objimgInformacoes_DataNascimento.title = "A data de nascimento é inválida. O campo deve ser preenchido no formato DD/MM/AAAA, onde DD é o dia, MM é o mês e AAAA é o ano."; //GetErroMessage("76")
objimgInformacoes_DataNascimento.style.display = "";
strRtn = false;
}
else
{
if ((objtxtDataNascimento.value.indexOf("/") != -1 && objtxtDataNascimento.value.indexOf("-") != -1) ||
(objtxtDataNascimento.value.indexOf("/") != -1 && (objtxtDataNascimento.value.indexOf("/") != 2 || objtxtDataNascimento.value.lastIndexOf("/") != 5)) ||
(objtxtDataNascimento.value.indexOf("-") != -1 && (objtxtDataNascimento.value.indexOf("-") != 2 || objtxtDataNascimento.value.lastIndexOf("-") != 5)))
{
objlblInformacoes_DataNascimento.style.color = "Red";
objimgInformacoes_DataNascimento.title = "A data de nascimento é inválida. O campo deve ser preenchido no formato DD/MM/AAAA, onde DD é o dia, MM é o mês e AAAA é o ano."; //GetErroMessage("76")
objimgInformacoes_DataNascimento.style.display = "";
strRtn = false;
}
else
{
Dia = objtxtDataNascimento.value.substring(0,2);
Mes = objtxtDataNascimento.value.substring(3,5);
Ano = objtxtDataNascimento.value.substring(6,10);
if (isNaN(Dia) || isNaN(Mes) || isNaN(Ano))
{
objlblInformacoes_DataNascimento.style.color = "Red";
objimgInformacoes_DataNascimento.title = "A data de nascimento é inválida. O campo deve ser preenchido no formato DD/MM/AAAA, onde DD é o dia, MM é o mês e AAAA é o ano."; //GetErroMessage("76")
objimgInformacoes_DataNascimento.style.display = "";
strRtn = false;
}
else
{
if (Dia < 1 || Mes < 1 || Mes > 12 || Ano < 1900)
{
objlblInformacoes_DataNascimento.style.color = "Red";
objimgInformacoes_DataNascimento.title = "A data de nascimento é inválida. O campo deve ser preenchido no formato DD/MM/AAAA, onde DD é o dia, MM é o mês e AAAA é o ano."; //GetErroMessage("76")
objimgInformacoes_DataNascimento.style.display = "";
strRtn = false;
}
else
{
switch (Mes)
{
case "01" :
{
}
case "03" :
{
}
case "05" :
{
}
case "07" :
{
}
case "08" :
{
}
case "10" :
{
}
case "12" :
{
if (Dia > 31)
{
objlblInformacoes_DataNascimento.style.color = "Red";
objimgInformacoes_DataNascimento.title = "A data de nascimento é inválida. O campo deve ser preenchido no formato DD/MM/AAAA, onde DD é o dia, MM é o mês e AAAA é o ano."; //GetErroMessage("76")
objimgInformacoes_DataNascimento.style.display = "";
strRtn = false;
}
break;
}
case "04" :
{
}
case "06" :
{
}
case "09" :
{
}
case "11" :
{
if (Dia > 30)
{
objlblInformacoes_DataNascimento.style.color = "Red";
objimgInformacoes_DataNascimento.title = "A data de nascimento é inválida. O campo deve ser preenchido no formato DD/MM/AAAA, onde DD é o dia, MM é o mês e AAAA é o ano."; //GetErroMessage("76")
objimgInformacoes_DataNascimento.style.display = "";
strRtn = false;
}
break;
}
case "02" :
{
if ((Ano % 4 != 0 && Dia > 28) || (Ano % 4 == 0 && Dia > 29))
{
objlblInformacoes_DataNascimento.style.color = "Red";
objimgInformacoes_DataNascimento.title = "A data de nascimento é inválida. O campo deve ser preenchido no formato DD/MM/AAAA, onde DD é o dia, MM é o mês e AAAA é o ano."; //GetErroMessage("76")
objimgInformacoes_DataNascimento.style.display = "";
strRtn = false;
}
break;
}
}
DataNascimentoComparacao = Ano + Mes + Dia;
DataAtual = document.getElementById("txtDataAtual").value;
DiaAtual = DataAtual.substring(0,DataAtual.indexOf("/"));
MesAtual = DataAtual.substring(DataAtual.indexOf("/")+1,DataAtual.lastIndexOf("/"));
AnoAtual = DataAtual.substring(DataAtual.lastIndexOf("/")+1,DataAtual.length);
if (DiaAtual.length == 1)
{
DiaAtual = "0" + DiaAtual;
}
if (MesAtual.length == 1)
{
MesAtual = "0" + MesAtual;
}
DataAtualComparacao = AnoAtual + MesAtual + DiaAtual;
if (DataNascimentoComparacao > DataAtualComparacao)
{
objlblInformacoes_DataNascimento.style.color = "Red";
objimgInformacoes_DataNascimento.title = "A data de nascimento é inválida. O campo deve ser preenchido com data anterior à data atual."; //GetErroMessage("102")
objimgInformacoes_DataNascimento.style.display = "";
strRtn = false;
}
else
{
objtxtDataNascimento.value = objtxtDataNascimento.value.replace('-','/').replace('-','/');
}
}
}
}
}
}
if (objtxtEnderecoEstado.value.length > 0)
{
if (objtxtEnderecoPais.value != "Brasil")
{
objlblEndereco_Pais.style.color = "Red";
objimgEndereco_Pais.title = "Ao escolher um estado deve-se selecionar o país como Brasil."; //GetErroMessage("96")
objimgEndereco_Pais.style.display = "";
strRtn = false;
}
}
if ((objchkDeficiencia.checked) && (objtxtDeficienciaGrupo.value.length == 0)) {
objlblDeficienciaGrupo.style.color = "Red";
objimgDeficienciaGrupo.title = "Ao marcar o indicador de deficiência deve-se selecionar um grupo."; //GetErroMessage("97")
objimgDeficienciaGrupo.style.display = "";
strRtn = false;
}


if (objtxtDependentes.value.length > 0 && isNaN(objtxtDependentes.value))
{
objlblInformacoes_Dependentes.style.color = "Red";
objimgInformacoes_Dependentes.title = "O campo deve ser preenchido apenas com números."; //GetErroMessage("93")
objimgInformacoes_Dependentes.style.display = "";
strRtn = false;
}
return strRtn;
}

