var cknome = 'indefinida'; //alert(cknome); function pos(){ meupop = window.open('http://vendas.centraldocarnaval.com.br/entrada.asp?cms=1030','page','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=20,height=20'); } function pegaTipo(var1, var2){ document.getElementById("bns_tipo").value = var1; document.getElementById("bns_qltipo").value = var2; } function chamaFcn(v1, v2){ qlSession = v1; if(qlSession == 'comSession'){ validaCampos(); } if(qlSession == 'semSession'){ var qlvalue = v2; var arr_fcn = qlvalue.split(","); var divX = arr_fcn[0]; var leftX = arr_fcn[1]; var topX = arr_fcn[2]; exibirp(divX,leftX,topX); } } function validaCampos(){ novoCpf = document.getElementById("bns_cpf").value; if (!check_cpf(novoCpf)) { document.getElementById("bns_cpf").focus(); return false; } if (document.getElementById("bns_email").value == "") { alert('Email inválido!'); document.getElementById("bns_email").focus(); return false; } email1 = document.getElementById("bns_email").value.indexOf("@"); email2 = document.getElementById("bns_email").value.indexOf("."); email3 = document.getElementById("bns_email").value.length; if (!(email1 >= 3 && email2 >= 6 && email3 >= 9)) { alert ("Email inválido!"); document.getElementById("bns_email").focus(); return false; } pos(); expira(); } function isMail(mens){ //obj -> Objeto do formulário. obj = document.getElementById("bns_email").value; arroba = "@"; mail = obj if (mail == "") { alert(mens); return false; } } function check_cpf(numcpf){ x = 0; soma = 0; dig1 = 0; dig2 = 0; texto = ""; numcpf1=""; len = numcpf.length; x = len -1; // var numcpf = "12345678909"; for (var i=0; i <= len - 3; i++) { y = numcpf.substring(i,i+1); soma = soma + ( y * x); x = x - 1; texto = texto + y; } dig1 = 11 - (soma % 11); if (dig1 == 10) dig1=0 ; if (dig1 == 11) dig1=0 ; numcpf1 = numcpf.substring(0,len - 2) + dig1 ; x = 11; soma=0; for (var i=0; i <= len - 2; i++) { soma = soma + (numcpf1.substring(i,i+1) * x); x = x - 1; } dig2= 11 - (soma % 11); if (dig2 == 10) dig2=0; if (dig2 == 11) dig2=0; //alert ("Digito Verificador : " + dig1 + "" + dig2); if (((dig1 + "" + dig2) == numcpf.substring(len,len-2))) { return true; } alert ("Numero do CPF invalido !!!"); return false; } function expira() { qlCpf = document.getElementById("bns_cpf").value; qlEmail = document.getElementById("bns_email").value; tipo = document.getElementById("bns_tipo").value; valor = document.getElementById("bns_qltipo").value; if (valor != 'nulo' && valor != '') { cknome = valor; } else { cknome = 'indefinida' } if (meupop==null || typeof(meupop)=="undefined") { alert("O Bloqueador de Pop-up esta ativado, desbloquei-o por favor"); } else { if (tipo == 'p_saojoao') { window.setTimeout('p_saojoao()', 1000); } if (tipo == 'p_torcida') { window.setTimeout('p_torcida()', 1000); } if (tipo == 'p_namorados') { window.setTimeout('p_namorados()', 1000); } if (tipo == 'c_blocos') { window.setTimeout('c_blocos()', 1000); } if (tipo == 'c_camarotes') { window.setTimeout('c_camarotes()', 1000); } if (tipo == 'p_blocos') { window.setTimeout('p_blocos()', 1000); } if (tipo == 'p_camarotes') { window.setTimeout('p_camarotes()', 1000); } if (tipo == 'p_cmcasal') { window.setTimeout('p_cmcasal()', 1000); } if (tipo == 'p_premiados') { window.setTimeout('p_premiados()', 1000); } } } function c_blocos() { meupop.close(); parent.location="http://efolia.com.br/salvador/c_blocos.php?valor="+cknome+"&cpf="+qlCpf+"&email="+qlEmail; } function c_camarotes() { meupop.close(); parent.location="http://efolia.com.br/salvador/c_camarotes.php?valor="+cknome+"&cpf="+qlCpf+"&email="+qlEmail; } function p_blocos() { meupop.close(); parent.location="http://efolia.com.br/salvador/p_blocos.php?cpf="+qlCpf+"&email="+qlEmail; } function p_camarotes() { meupop.close(); parent.location="http://efolia.com.br/salvador/p_camarotes.php?cpf="+qlCpf+"&email="+qlEmail; } function p_cmcasal() { meupop.close(); parent.location="http://efolia.com.br/salvador/p_cmcasal.php?cpf="+qlCpf+"&email="+qlEmail; } function p_premiados() { meupop.close(); parent.location="http://efolia.com.br/salvador/p_premiados.php?cpf="+qlCpf+"&email="+qlEmail; } function p_saojoao() { meupop.close(); parent.location="http://efolia.com.br/salvador/p_saojoao.php?cpf="+qlCpf+"&email="+qlEmail; } function p_torcida() { meupop.close(); parent.location="http://efolia.com.br/salvador/p_torcida.php?cpf="+qlCpf+"&email="+qlEmail; } function p_namorados() { meupop.close(); parent.location="http://efolia.com.br/salvador/p_namorados.php?cpf="+qlCpf+"&email="+qlEmail; } function fechar() { meupop.close(); }