﻿<!--

 function checkdata() {
	with(document.pagamento) {	
	        if (nome.value == "") {
			alert("Você não se identificou. Informe seu nome");
			nome.focus();
			return false; }
			
						
			 if (cpfpassaporte.value == "") {
			alert("Informe seu CPF");
			cpfpassaporte.focus();
			return false; }
			
			
 if (cpfpassaporte.value == "11111111111") {
			alert("CPF inválido");
			cpfpassaporte.focus();
			return false; }		
		
		
 if (cpfpassaporte.value == "22222222222") {
			alert("CPF inválido");
			cpfpassaporte.focus();
			return false; }	
			
 if (cpfpassaporte.value == "33333333333") {
			alert("CPF inválido");
			cpfpassaporte.focus();
			return false; }	
			
 if (cpfpassaporte.value == "44444444444") {
			alert("CPF inválido");
			cpfpassaporte.focus();
			return false; }	
			
 if (cpfpassaporte.value == "55555555555") {
			alert("CPF inválido");
			cpfpassaporte.focus();
			return false; }	
			
 if (cpfpassaporte.value == "66666666666") {
			alert("CPF inválido");
			cpfpassaporte.focus();
			return false; }	
			
 if (cpfpassaporte.value == "77777777777") {
			alert("CPF inválido");
			cpfpassaporte.focus();
			return false; }	
			
 if (cpfpassaporte.value == "88888888888") {
			alert("CPF inválido");
			cpfpassaporte.focus();
			return false; }	
			
 if (cpfpassaporte.value == "99999999999") {
			alert("CPF inválido");
			cpfpassaporte.focus();
			return false; }	
			
 if (cpfpassaporte.value == "00000000000") {
			alert("CPF inválido");
			cpfpassaporte.focus();
			return false; }				
		
		
		
		
  
var i; 
  
s = document.pagamento.cpfpassaporte.value; 
  
var c = s.substr(0,9); 
  
var dv = s.substr(9,2); 
  
var d1 = 0; 
  
for (i = 0; i < 9; i++) 
  
{ 
  
d1 += c.charAt(i)*(10-i); 
  
} 
  
if (d1 == 0){ 
  
alert("CPF Inválido") 
  
return false; 
cpfpassaporte.focus();
} 
  
d1 = 11 - (d1 % 11); 
  
if (d1 > 9) d1 = 0; 
  
if (dv.charAt(0) != d1) 
  
{ 
  
alert("CPF Inválido") 
  
return false; 
cpfpassaporte.focus();
} 
  
  
d1 *= 2; 
  
for (i = 0; i < 9; i++) 
  
{ 
  
d1 += c.charAt(i)*(11-i); 
  
} 
  
d1 = 11 - (d1 % 11); 
  
if (d1 > 9) d1 = 0; 
  
if (dv.charAt(1) != d1) 
  
{ 
  
alert("CPF Inválido") 
  
return false; 
cpfpassaporte.focus();  
} 
  

		
		
		
		
		
			
			
		
		 if (email.value == "") {
			alert("Informe seu e-mail. Caso ainda não tenha, adquira gratuitamente no site www.hotmail.com!");
			email.focus();
			return false; 
		}
		
		
		prim = email.value.indexOf("@")
		if(prim < 2) {
			alert("E-mail sem @ é inválido.");
			email.focus();
			email.select();
			return false;
		}
		
		if(email.value.indexOf("@",prim + 1) != -1) {
			alert("O e-mail informado não está correto.");
			email.focus();
			email.select();
			return false;
		}
		
		
		if(email.value.indexOf(".") < 1) {
			alert("O e-mail informado parece não está correto.");
			email.focus();
			email.select();
			return false;
		}

		
		if(email.value.indexOf(",")  > 0) {
			alert("Nào utilize vírgula no e-mail.");
			email.focus();
			email.select();
			return false;
		}
		
		
		if(email.value.indexOf("[") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			email.select();
			return false;
		}
		
		
		if(email.value.indexOf("]") > 0) {
			alert("O e-mail informado parece não estar correto.");
			email.focus();
			email.select();
			return false;
		}
		
		
		  if (endereco.value == "") {
			alert("Informe seu endereço !");
			endereco.focus();
			return false; }
			
			
			  if (bairro.value == "") {
			alert("Informe seu bairro !");
			bairro.focus();
			return false; }
			
			
			  if (cidade.value == "") {
			alert("Informe sua cidade !");
			cidade.focus();
			return false; }
			
			
			
			  if (cepcadastro.value == "") {
			alert("Informe o cep!");
			cep.focus();
			return false; }			
			
			
			{
	if (cepcadastro.value) // Internet Explorer
		var tecla = event.keyCode;
	else if(document.layers) // Nestcape
		var tecla = e.which;
		if (tecla > 47 && tecla < 58) // numeros de 0 a 9
			return true;
		else
			{
				if (tecla != 8) // backspace
					event.keyCode = 0;
					//return false;
				else
					return true;
			}
}



    
	 if (cepcadastro.value.length == 8) 
   		{
   			return true;
   		}
   	 else
   		{ 
 			alert("O campo cep deve possuir 8 números no formato XXXXXXXX.");
			cep.focus();
			return false; 
   		}





		
		
		
		
                        submit();
	}
}




function validacpfpassaporte(){ 
  
var i; 
  
s = document.pagamento.cpfpassaporte.value; 
  
var c = s.substr(0,9); 
  
var dv = s.substr(9,2); 
  
var d1 = 0; 
  
for (i = 0; i < 9; i++) 
  
{ 
  
d1 += c.charAt(i)*(10-i); 
  
} 
  
if (d1 == 0){ 
  
alert("CPF Inválido") 
  
return false; 
cpfpassaporte.focus();
} 
  
d1 = 11 - (d1 % 11); 
  
if (d1 > 9) d1 = 0; 
  
if (dv.charAt(0) != d1) 
  
{ 
  
alert("CPF Inválido") 
  
return false; 
cpfpassaporte.focus();
} 
  
  
d1 *= 2; 
  
for (i = 0; i < 9; i++) 
  
{ 
  
d1 += c.charAt(i)*(11-i); 
  
} 
  
d1 = 11 - (d1 % 11); 
  
if (d1 > 9) d1 = 0; 
  
if (dv.charAt(1) != d1) 
  
{ 
  
alert("CPF Inválido") 
  
return false; 
cpfpassaporte.focus();  
} 
  
return true; 
  
} 






//-->




  

  


