function VerificaEmail(url) { oXmlReq = null; if (window.XMLHttpRequest) { oXmlReq = new XMLHttpRequest(); oXmlReq.onreadystatechange = ProcessaEmail; oXmlReq.open("GET",url,true); oXmlReq.send(null); if (oXmlReq.readyState == 4) { if (oXmlReq.status ==200) { if (oXmlReq.responseText == 'true') { alert("Email já cadastrado em nossa base"); VerificaEmail = true; } } else { alert("Ocorreu exceção ao obter os dados:n" + oXmlReq.statusText); return false; } } } else if (window.ActiveXObject) { oXmlReq = new ActiveXObject("Microsoft.XMLHTTP"); if (oXmlReq) { oXmlReq.open("GET",url,true); oXmlReq.send(); if (oXmlReq.readyState == 4) { if (oXmlReq.status ==200) { if (oXmlReq.responseText == 'true') { alert("Email já cadastrado em nossa base"); VerificaEmail = true; } } else { alert("Ocorreu exceção ao obter os dados:n" + oXmlReq.statusText); return false; } } } } return false; } function ProcessaEmail() { if (oXmlReq.readyState == 4) { if (oXmlReq.status ==200) { if (oXmlReq.responseText == 'true') { alert("Email já cadastrado em nossa base"); } } else { alert("Ocorreu exceção ao obter os dados:n" + oXmlReq.statusText); } } } var CorAlerta = "#FFEDD2"; var CorNormal = "#FFFFFF"; function Prosseguir(valor) { var oHead = document.getElementsByTagName('head').item(0); var oScript = document.createElement('script'); var curDateTime = new Date() var curHour = curDateTime.getHours() var curMin = curDateTime.getMinutes() var curSec = curDateTime.getSeconds() cCEP1 = document.getElementById("txtCEP1").value; cCEP2 = document.getElementById("txtCEP2").value; if (cCEP1 == null || cCEP1 == "") { alert("Por favor informe o cep"); document.getElementById("txtCEP1").focus(); return false; } if (cCEP2 == null || cCEP2 == "") { alert("Por favor informe o cep"); document.getElementById("txtCEP2").focus(); return false; } cParametros = cCEP1 + cCEP2 + "&t=" + curHour + curMin + curSec; oScript.setAttribute('src', 'VerificaCep.asp?cep=' + cParametros +'&c='+valor ); oHead.appendChild(oScript); } function VerificaCepNovo() { var oHead = document.getElementsByTagName('head').item(0); var oScript = document.createElement('script'); var curDateTime = new Date() var curHour = curDateTime.getHours() var curMin = curDateTime.getMinutes() var curSec = curDateTime.getSeconds() cCEP1 = document.getElementById("txtCEP1").value; cCEP2 = document.getElementById("txtCEP2").value; if (cCEP1 == null || cCEP1 == "") { alert("Por favor informe o cep"); document.getElementById("txtCEP1").focus(); return false; } if (cCEP2 == null || cCEP2 == "") { alert("Por favor informe o cep"); document.getElementById("txtCEP2").focus(); return false; } cParametros = cCEP1 + cCEP2 + "&t=" + curHour + curMin + curSec; oScript.setAttribute('src', 'VerificaCepNovo.asp?cep=' + cParametros ); oHead.appendChild(oScript); } function VerificaCEP() { var oHead = document.getElementsByTagName('head').item(0); var oScript = document.createElement('script'); var cCep1 = document.createElement('txtCep1'); var cCep2 = document.createElement('txtCep2'); oScript.setAttribute('src', 'VerificaCep.asp?cep=' + cCep1 + cCep2); oHead.appendChild(oScript); } function PesquisaCep() { var cEndereco; var cCidade; var cEstado; var cParametros; cEndereco = document.getElementById("txtEndereco").value; cCidade = document.getElementById("txtCidade").value; //cEstado = document.getElementById("txtEstado").options(document.getElementById("txtEstado").selectedIndex); cEstado = document.getElementById("txtEstado").value; if (cEndereco.length < 3) { alert("O endereço deve conter mais de 3 caracteres"); document.getElementById("txtEndereco").focus(); return false; } cParametros = "txtEndereco=" + encodeHtml(cEndereco) + "&txtCidade=" + encodeHtml(cCidade) + "&txtEstado=" + cEstado; enviaPagina('cliente_cep.asp', 'POST', 'true', 'conteudo', cParametros) } function PesquisaCepCliente() { var cEndereco; var cCidade; var cEstado; var cParametros; cEndereco = document.getElementById("txtEndereco").value; cCidade = document.getElementById("txtCidade").value; //cEstado = document.getElementById("txtEstado").options(document.getElementById("txtEstado").selectedIndex); cEstado = document.getElementById("txtEstado").value; if (cEndereco.length < 3) { alert("O endereço deve conter mais de 3 caracteres"); document.getElementById("txtEndereco").focus(); return false; } cParametros = "txtEndereco=" + encodeHtml(cEndereco) + "&txtCidade=" + encodeHtml(cCidade) + "&txtEstado=" + cEstado; enviaPagina('cadastro.asp', 'POST', 'true', 'conteudo', cParametros) } function PesquisaCepEndereco() { var cEndereco; var cCidade; var cEstado; var cParametros; cEndereco = document.getElementById("txtEndereco").value; cCidade = document.getElementById("txtCidade").value; //cEstado = document.getElementById("txtEstado").options(document.getElementById("txtEstado").selectedIndex); cEstado = document.getElementById("txtEstado").value; if (cEndereco.length < 3) { alert("O endereço deve conter mais de 3 caracteres"); document.getElementById("txtEndereco").focus(); return false; } cParametros = "txtEndereco=" + encodeHtml(cEndereco) + "&txtCidade=" + encodeHtml(cCidade) + "&txtEstado=" + cEstado; enviaPagina('cliente_endereco_cep.asp', 'POST', 'true', 'cliente_painel', cParametros) } function pFisica(){ document.getElementById('txtTipoPessoa').value = "F"; document.getElementById('inscricao').style.display = "none"; document.getElementById('sexo').style.display = "block"; document.getElementById('residencial').style.display = "block"; document.getElementById('celular').style.display = "block"; document.getElementById('lblNome').style.display = "block"; document.getElementById('lblCPF').style.display = "block"; document.getElementById('txtCPF').maxlength = 11; document.getElementById('lblRazao').style.display = "none"; document.getElementById('lblCNPJ').style.display = "none"; exibeDiv('cmdJuridica2'); someDiv('cmdFisica'); } function pJuridica(){ document.getElementById('txtTipoPessoa').value = "J"; document.getElementById('inscricao').style.display = "block"; document.getElementById('sexo').style.display = "none"; document.getElementById('residencial').style.display = "none"; document.getElementById('celular').style.display = "none"; document.getElementById('lblNome').style.display = "none"; document.getElementById('lblCPF').style.display = "none"; document.getElementById('txtCPF').maxlength = 14; document.getElementById('lblRazao').style.display = "block"; document.getElementById('lblCNPJ').style.display = "block"; exibeDiv('cmdFisica'); someDiv('cmdJuridica2'); } function checa_cpf(CPF) { var mensagem = "informe corretamente o número do CPF" var msg = ""; if (CPF.length != 11 || CPF == "00000000000" || CPF == "11111111111" || CPF == "22222222222" || CPF == "33333333333" || CPF == "44444444444" || CPF == "55555555555" || CPF == "66666666666" || CPF == "77777777777" || CPF == "88888888888" || CPF == "99999999999") msg = mensagem; soma = 0; for (y=0; y < 9; y ++) soma += parseInt(CPF.charAt(y)) * (10 - y); resto = 11 - (soma % 11); if (resto == 10 || resto == 11)resto = 0; if (resto != parseInt(CPF.charAt(9))) msg = mensagem; soma = 0; for (y = 0; y < 10; y ++) soma += parseInt(CPF.charAt(y)) * (11 - y); resto = 11 - (soma % 11); if (resto == 10 || resto == 11) resto = 0; if (resto != parseInt(CPF.charAt(10))) msg = mensagem; return msg; } function PesquisaCep() { var cEndereco; var cCidade; var cEstado; var cParametros; cEndereco = document.getElementById("txtEndereco").value; cCidade = document.getElementById("txtCidade").value; //cEstado = document.getElementById("txtEstado").options(document.getElementById("txtEstado").selectedIndex); cEstado = document.getElementById("txtEstado").value; if (cEndereco.length < 3) { alert("O endereço deve conter mais de 3 caracteres"); document.getElementById("txtEndereco").focus(); return false; } cParametros = "txtEndereco=" + encodeHtml(cEndereco) + "&txtCidade=" + encodeHtml(cCidade) + "&txtEstado=" + cEstado; enviaPagina('cliente_cep.asp', 'POST', 'true', 'conteudo', cParametros) } function checa_cnpj(s) { var mensagem = "informe corretamente o número do CNPJ" var msg = ""; var y; var c = s.substr(0,12); var dv = s.substr(12,2); var d1 = 0; for (y = 0; y < 12; y++) { d1 += c.charAt(11-y)*(2+(y % 8)); } if (d1 == 0) msg = mensagem; d1 = 11 - (d1 % 11); if (d1 > 9) d1 = 0; if (dv.charAt(0) != d1)msg = mensagem; d1 *= 2; for (y = 0; y < 12; y++) { d1 += c.charAt(11-y)*(2+((y+1) % 8)); } d1 = 11 - (d1 % 11); if (d1 > 9) d1 = 0; if (dv.charAt(1) != d1) msg = mensagem; return msg; } function SalvaCliente(cPainel) { var oHead = document.getElementsByTagName('head').item(0); var oScript = document.createElement('script'); var curDateTime = new Date() var curHour = curDateTime.getHours() var curMin = curDateTime.getMinutes() var curSec = curDateTime.getSeconds() var cCodigo = ""; var cNome = ""; var cCpf = ""; var cInscricaoEstadual = ""; var cIsento = ""; var cSexo = ""; var cDtNascimento = ""; var cDddRes = ""; var cTelRes = ""; var cDddCel = ""; var cTelCel = ""; var cDddCom = ""; var cTelCom = ""; var cRamal = ""; var cTipoPessoa = ""; var cEmail = ""; var cSenha = ""; var cConfSenha = ""; var cTratamento = ""; var cRecebeEmail = ""; var cEndereco = ""; var cNumero = ""; var cComplemento = ""; var cReferencia = ""; var cCEP = ""; var cBairro = ""; var cCidade = ""; var cDeEndereco = ""; var cTipoEndereco = ""; var cCarrinho = ""; var cParametros = ""; cTipoPessoa = document.getElementById("txtTipoPessoa").value; cCodigo = document.getElementById("txtCodigo").value; cNome = document.getElementById("txtNome").value; cCpf = document.getElementById("txtCpf").value; cInscricaoEstadual= document.getElementById("txtInscricaoEstadual").value; cIsento = document.getElementById("txtIsento").value; cSexo = document.getElementById("txtSexo").value; cConfSenha = document.getElementById("txtConfirmaSenha").value; cDtNascimento = document.getElementById("txtDtNascimento").value; cDddRes = document.getElementById("txtDddRes").value; cTelRes = document.getElementById("txtTelRes").value; cDddCel = document.getElementById("txtDddCel").value; cTelCel = document.getElementById("txtTelCel").value; cDddCom = document.getElementById("txtDddCom").value; cTelCom = document.getElementById("txtTelCom").value; cRamal = document.getElementById("txtRamal").value; cEmail = document.getElementById("txtEmail").value; cSenha = document.getElementById("txtSenha").value; cTratamento = document.getElementById("txtTratamento").value; cRecebeEmail = document.getElementById("txtRecebeEmail").value; cCdEndereco = document.getElementById("txtCdEndereco").value; cEndereco = document.getElementById("txtEndereco").value; cNumero = document.getElementById("txtNumero").value; cComplemento = document.getElementById("txtComplemento").value; cReferencia = document.getElementById("txtReferencia").value; cCEP = document.getElementById("txtCEP").value; cBairro = document.getElementById("txtBairro").value; cCidade = document.getElementById("txtCidade").value; cDeEndereco = document.getElementById("txtDeEndereco").value; cTipoEndereco = document.getElementById("txtTipoEndereco").value; cCarrinho = document.getElementById("c").value; if (cCodigo == "" || cCodigo == null) { cCodigo = 0; } if (cNome == null || cNome == "") { if (cTipoPessoa == 'F') { alert("Por favor informe o Nome Completo"); } else { alert("Por favor informe a Razão Social"); } document.getElementById("txtNome").style.background = CorAlerta; document.getElementById("txtNome").focus(); return false; } else { document.getElementById("txtNome").style.background = CorNormal; } //-------------- CPF ------------- if (cCpf == null || cCpf == "") { if (cTipoPessoa == 'F') { alert("Por favor informe o CPF"); } else { alert("Por favor informe o CNPJ"); } document.getElementById("txtCPF").focus(); document.getElementById("txtCPF").style.background = CorAlerta; return false; } else { document.getElementById("txtCPF").style.background = CorNormal; } var cRetorno = ""; if (cTipoPessoa == 'F') { cRetorno = checa_cpf(cCpf) } else { cRetorno = checa_cnpj(cCpf) } if (cRetorno != "") { alert(cRetorno); document.getElementById("txtCPF").focus() document.getElementById("txtCPF").style.background = CorAlerta; return false; } else { document.getElementById("txtCPF").style.background = CorNormal; } //--------------------- Fim CPF ------------- //-------------------- Validação Pessoa Física if (cTipoPessoa == 'F') { if (cSexo == "") { alert("Por favor informe o Sexo"); document.getElementById("txtSexo").focus(); document.getElementById("txtSexo").style.background = CorAlerta; return false; } else { document.getElementById("txtSexo").style.background = CorNormal; } if (cDtNascimento == "") { alert("Por favor informe a Data de Nascimento"); document.getElementById("txtDtNascimento").focus(); document.getElementById("txtDtNascimento").style.background = CorAlerta; return false; } else { document.getElementById("txtDtNascimento").style.background = CorNormal; } } else { if (document.getElementById("txtIsento").checked == false) { if (cInscricaoEstadual == "") { alert("Por favor informe a Inscricao Estadual"); document.getElementById("txtInscricaoEstadual").focus(); document.getElementById("txtInscricaoEstadual").style.background = CorAlerta; return false; } else { document.getElementById("txtInscricaoEstadual").style.background = CorNormal; } } } if (cDddRes == null || cDddRes == "") { alert("Por favor informe o DDD residencial"); document.getElementById("txtDddRes").style.background = CorAlerta; document.getElementById("txtDddRes").focus(); return false; } else { document.getElementById("txtDddRes").style.background = CorNormal; } if (cTelRes == null || cTelRes == "") { alert("Por favor informe o telefone residencial"); document.getElementById("txtTelRes").style.background = CorAlerta; document.getElementById("txtTelRes").focus(); return false; } else { document.getElementById("txtTelRes").style.background = CorNormal; } //---------------------------------------------- if (cEmail == "") { alert("Por favor informe um Email"); document.getElementById("txtEmail").focus(); document.getElementById("txtEmail").style.background = CorAlerta; return false; } else { var msg = checa_email(document.getElementById("txtEmail").value); if (msg != "") { alert(msg); document.getElementById("txtEmail").focus(); document.getElementById("txtEmail").style.background = CorAlerta; return false; } document.getElementById("txtEmail").style.background = CorNormal; //oScript.setAttribute('src', 'VerificaEmail.asp?email=' + cEmail ); url = 'VerificaEmail.asp?email=' + encodeHtml(cEmail) + "&t=" + curHour + curMin + curSec; // ************************************************ // Verifica Email // ************************************************ var oXmlReq = null; var curDateTime = new Date() var curHour = curDateTime.getHours() var curMin = curDateTime.getMinutes() var curSec = curDateTime.getSeconds() if (window.XMLHttpRequest) { oXmlReq = new XMLHttpRequest(); oXmlReq.open("GET",url,true); oXmlReq.send(null); if (oXmlReq.readyState == 4) { if (oXmlReq.status == 200) { if (oXmlReq.responseText == 'true') { alert("Email já cadastrado em nossa base"); return false; } } else { alert("Ocorreu exceção ao obter os dados:n" + oXmlReq.statusText); return false; } } } else if (window.ActiveXObject) { oXmlReq = new ActiveXObject("Microsoft.XMLHTTP"); if (oXmlReq) { oXmlReq.open("GET",url,true); oXmlReq.send(); if (oXmlReq.readyState == 4) { if (oXmlReq.status == 200) { if (oXmlReq.responseText == 'true') { alert("Email já cadastrado em nossa base"); return false; } } else { alert("Ocorreu exceção ao obter os dados:n" + oXmlReq.statusText); return false; } } } } // ************************************************* // Fim da Rotina que Verifica Email // ************************************************* //oHead.appendChild(oScript); } if (cSenha == null || cSenha == "") { alert("Por favor informe uma Senha"); document.getElementById("txtSenha").focus(); document.getElementById("txtSenha").style.background = CorAlerta; return false; } else { document.getElementById("txtSenha").style.background = CorNormal; } if (cConfSenha == null || cConfSenha == "") { alert("Por favor informe confirme a Senha"); document.getElementById("txtConfirmaSenha").focus(); document.getElementById("txtConfirmaSenha").style.background = CorAlerta; return false; } else { document.getElementById("txtConfirmaSenha").style.background = CorNormal; } if (cSenha != cConfSenha) { alert("Senha não confere"); document.getElementById("txtConfirmaSenha").focus(); document.getElementById("txtConfirmaSenha").style.background = CorAlerta; return false; } else { document.getElementById("txtConfirmaSenha").style.background = CorNormal; } //--------------------------------------------------------- if (document.getElementById("txtIsento").checked == true) { cIsento = "S"; } else { cIsento = "N"; } //-------------------------------------------------- if (cEndereco == "") { alert("Por favor informe o Endereco"); document.getElementById("txtEndereco").focus(); document.getElementById("txtEndereco").style.background = CorAlerta; return false; } else { document.getElementById("txtEndereco").style.background = CorNormal; } if (cNumero == "") { alert("Por favor informe o Numero"); document.getElementById("txtNumero").focus(); document.getElementById("txtNumero").style.background = CorAlerta; return false; } else { document.getElementById("txtNumero").style.background = CorNormal; } if (cBairro == "") { alert("Por favor informe o Bairro"); document.getElementById("txtBairro").focus(); document.getElementById("txtBairro").style.background = CorAlerta; return false; } else { document.getElementById("txtBairro").style.background = CorNormal; } cParametros = "txtCodigo=" + cCodigo + "&txtNome=" + encodeHtml(cNome) + "&txtCpf=" + cCpf + "&txtInscricaoEstadual=" + cInscricaoEstadual + "&txtIsento=" + cIsento + "&txtSexo=" + cSexo + "&txtDtNascimento=" + cDtNascimento + "&txtTipoPessoa=" + cTipoPessoa + "&txtDddRes=" + cDddRes + "&txtTelRes=" + cTelRes + "&txtDddCel=" + cDddCel + "&txtTelCel=" + cTelCel + "&txtDddCom=" + cDddCom + "&txtTelCom=" + cTelCom + "&txtRamal=" + cRamal + "&txtEmail=" + encodeHtml(cEmail) + "&txtSenha=" + cSenha + "&txtTratamento=" + encodeHtml(cTratamento) + "&txtRecebeEmail=" + cRecebeEmail + "&txtCdEndereco=" + encodeHtml(cCdEndereco) + "&txtEndereco=" + encodeHtml(cEndereco) + "&txtNumero=" + cNumero + "&txtComplemento=" + encodeHtml(cComplemento) + "&txtReferencia=" + encodeHtml(cReferencia) + "&txtCEP=" + encodeHtml(cCEP) + "&txtBairro=" + encodeHtml(cBairro) + "&txtCidade=" + cCidade + "&txtDeEndereco=" + encodeHtml(cDeEndereco) + "&txtTipoEndereco=" + encodeHtml(cTipoEndereco) + "&c=" + cCarrinho; if (cPainel == 'S') { enviaPagina('cliente_salva.asp', 'POST', 'true', 'cliente_painel', cParametros); } else { enviaPagina('cliente_salva.asp', 'POST', 'true', 'conteudo', cParametros); } } function marcaIsento(oCampo){ if (oCampo.checked == true) { document.getElementById('txtInscricaoEstadual').style.background = '#f5f5f5'; //document.getElementById('txtInscricaoEstadual').style.border = '#f3f3f3'; document.getElementById('txtInscricaoEstadual').disabled = true; } else { document.getElementById('txtInscricaoEstadual').style.background = '#ffffff'; //document.getElementById('txtInscricaoEstadual').style.border = '#fb9500'; document.getElementById('txtInscricaoEstadual').disabled = false; } } function ChecaLogin(cCarrinho) { var oHead = document.getElementsByTagName('head').item(0); var oScript = document.createElement('script'); var curDateTime = new Date() var curHour = curDateTime.getHours() var curMin = curDateTime.getMinutes() var curSec = curDateTime.getSeconds() cEmail = document.getElementById("txtEmail").value; cSenha = document.getElementById("txtSenha").value; if (cEmail == null || cEmail == "") { alert("Por favor informe o email"); document.getElementById("txtEmail").focus(); document.getElementById("txtEmail").style.background = CorAlerta; return false; } else { document.getElementById("txtEmail").style.background = CorNormal; } if (cSenha == null || cSenha == "") { alert("Por favor informe a Senha"); document.getElementById("txtSenha").focus(); document.getElementById("txtSenha").style.background = CorAlerta; return false; } else { document.getElementById("txtSenha").style.background = CorNormal; } cParametros = "email=" + cEmail + "&senha=" + cSenha + "&c=" + cCarrinho + "&t=" + curHour + curMin + curSec; oScript.setAttribute('src', 'VerificaLogin.asp?' + cParametros ); oHead.appendChild(oScript); } function Esqueci() { //var oHead = document.getElementsByTagName('head').item(0); //var oScript = document.createElement('script'); var curDateTime = new Date() var curHour = curDateTime.getHours() var curMin = curDateTime.getMinutes() var curSec = curDateTime.getSeconds() cEmail = document.getElementById("txtEmail").value; if (cEmail == null || cEmail == "") { alert("Por favor informe o email"); document.getElementById("txtEmail").focus(); document.getElementById("txtEmail").style.background = CorAlerta; return false; } else { document.getElementById("txtEmail").style.background = CorNormal; } cParametros = "email=" + cEmail + "&t=" + curHour + curMin + curSec; enviaPagina('esqueci.asp', 'POST', 'true', 'conteudo', cParametros); //oScript.setAttribute('src', 'esqueci.asp?' + cParametros ); //oHead.appendChild(oScript); } function TrocaSenha() { var cCodigo = ""; var cNome = ""; var cEmail = ""; var cSenha = ""; var cConfSenha = ""; var cParametros = ""; cCodigo = document.getElementById("txtCodigo").value; cNome = document.getElementById("txtNome").value; cSenha = document.getElementById("txtSenha").value; cEmail = document.getElementById("txtEmail").value; cConfSenha = document.getElementById("txtConfirmaSenha").value; if (cCodigo == "" || cCodigo == null) { cCodigo = 0; } if (cSenha == null || cSenha == "") { alert("Por favor informe uma Senha"); document.getElementById("txtSenha").focus(); document.getElementById("txtSenha").style.background = CorAlerta; return false; } else { document.getElementById("txtSenha").style.background = CorNormal; } if (cConfSenha == null || cConfSenha == "") { alert("Por favor informe confirme a Senha"); document.getElementById("txtConfirmaSenha").focus(); document.getElementById("txtConfirmaSenha").style.background = CorAlerta; return false; } else { document.getElementById("txtConfirmaSenha").style.background = CorNormal; } if (cSenha != cConfSenha) { alert("Senha não confere"); document.getElementById("txtConfirmaSenha").focus(); document.getElementById("txtConfirmaSenha").style.background = CorAlerta; return false; } else { document.getElementById("txtConfirmaSenha").style.background = CorNormal; } cParametros = "txtCodigo=" + cCodigo + "&txtNome=" + encodeHtml(cNome) + "&txtEmail=" + encodeHtml(cEmail) + "&txtSenha=" + cSenha; enviaPagina('cliente_senha_salva.asp', 'POST', 'true', 'cliente_painel', cParametros); } function TrocaEmail() { var cCodigo = ""; var cNome = ""; var cEmail = ""; var cParametros = ""; cCodigo = document.getElementById("txtCodigo").value; cNome = document.getElementById("txtNome").value; cEmail = document.getElementById("txtEmail").value; if (cCodigo == "" || cCodigo == null) { cCodigo = 0; } if (cEmail == "") { alert("Por favor informe um Email"); document.getElementById("txtEmail").focus(); document.getElementById("txtEmail").style.background = CorAlerta; return false; } else { var msg = checa_email(document.getElementById("txtEmail").value); if (msg != "") { alert(msg); document.getElementById("txtEmail").focus(); document.getElementById("txtEmail").style.background = CorAlerta; return false; } document.getElementById("txtEmail").style.background = CorNormal; } cParametros = "txtCodigo=" + cCodigo + "&txtNome=" + encodeHtml(cNome) + "&txtEmail=" + encodeHtml(cEmail); enviaPagina('cliente_email_salva.asp', 'POST', 'true', 'cliente_painel', cParametros); } function TrocaRecebe() { var cCodigo = ""; var cRecebeEmail = ""; var cParametros = ""; cCodigo = document.getElementById("txtCodigo").value; cRecebeEmail = document.getElementById("txtRecebeEmail").checked; if (cRecebeEmail == true){ cRecebeEmail = "S"; } else { cRecebeEmail = "N"; } if (cCodigo == "" || cCodigo == null) { cCodigo = 0; } cParametros = "txtCodigo=" + cCodigo + "&txtRecebeEmail=" + encodeHtml(cRecebeEmail); enviaPagina('cliente_recebe_salva.asp', 'POST', 'true', 'cliente_painel', cParametros); } function SalvaEnderecoNovo() { var oHead = document.getElementsByTagName('head').item(0); var oScript = document.createElement('script'); var curDateTime = new Date() var curHour = curDateTime.getHours() var curMin = curDateTime.getMinutes() var curSec = curDateTime.getSeconds() var cCodigo = ""; var cCdEndereco = ""; var cEndereco = ""; var cNumero = ""; var cComplemento = ""; var cReferencia = ""; //var cCEP = ""; var cCEP1 = ""; var cCEP2 = ""; var cBairro = ""; var cCidade = ""; var cDeEndereco = ""; var cTipoEndereco = ""; var cParametros = ""; cCodigo = document.getElementById("txtCodigo").value; cCdEndereco = document.getElementById("txtCdEndereco").value; cEndereco = document.getElementById("txtEndereco").value; cNumero = document.getElementById("txtNumero").value; cComplemento = document.getElementById("txtComplemento").value; cReferencia = document.getElementById("txtReferencia").value; //cCEP = document.getElementById("txtCEP").value; cCEP1 = document.getElementById("txtCEP1").value; cCEP2 = document.getElementById("txtCEP2").value; cCEP = cCEP1+cCEP2; cBairro = document.getElementById("txtBairro").value; cCidade = document.getElementById("txtCidade").value; cDeEndereco = document.getElementById("txtDeEndereco").value; cTipoEndereco = document.getElementById("txtTipoEndereco").value; if (cCdEndereco == "" || cCdEndereco == null) { cCdEndereco = 0; } if (cEndereco == "") { alert("Por favor informe o Endereco"); document.getElementById("txtEndereco").focus(); document.getElementById("txtEndereco").style.background = CorAlerta; return false; } else { document.getElementById("txtEndereco").style.background = CorNormal; } if (cNumero == "") { alert("Por favor informe o Numero"); document.getElementById("txtNumero").focus(); document.getElementById("txtNumero").style.background = CorAlerta; return false; } else { document.getElementById("txtNumero").style.background = CorNormal; } if (cBairro == "") { alert("Por favor informe o Bairro"); document.getElementById("txtBairro").focus(); document.getElementById("txtBairro").style.background = CorAlerta; return false; } else { document.getElementById("txtBairro").style.background = CorNormal; } cParametros = "txtCodigo=" + cCodigo + "&txtCdEndereco=" + cCdEndereco + "&txtEndereco=" + encodeHtml(cEndereco) + "&txtNumero=" + cNumero + "&txtComplemento=" + encodeHtml(cComplemento) + "&txtReferencia=" + encodeHtml(cReferencia) + "&txtCEP=" + encodeHtml(cCEP) + "&txtBairro=" + encodeHtml(cBairro) + "&txtCidade=" + cCidade + "&txtDeEndereco=" + encodeHtml(cDeEndereco) + "&txtTipoEndereco=" + encodeHtml(cTipoEndereco); enviaPagina('cliente_endereco_salva.asp', 'POST', 'true', 'cliente_painel', cParametros); } function MarcaEnderecoPrincipal() { var oHead = document.getElementsByTagName('head').item(0); var oScript = document.createElement('script'); var curDateTime = new Date() var curHour = curDateTime.getHours() var curMin = curDateTime.getMinutes() var curSec = curDateTime.getSeconds() var cCodigo = ""; var cCdEndereco = ""; var cParametros = ""; cCodigo = document.getElementById("txtCodigo").value; cCdEndereco = document.getElementById("txtCdEndereco").value; cParametros = "txtCodigo=" + cCodigo + "&txtCdEndereco=" + cCdEndereco + "&txtTipoEndereco=P&txtMarcaPrincipal=S"; enviaPagina('cliente_endereco_salva.asp', 'POST', 'true', 'cliente_painel', cParametros); } function Foca(campo) { document.getElementById(campo).focus(); }