       function validaCPFCALCULO(){
                       var cpf = document.formCalc.cpfsegurado.value;
                       var filtro = /^\d{3}.\d{3}.\d{3}-\d{2}$/i;
                       if(!filtro.test(cpf)){
                         //window.alert("CPF inválido. Tente novamente.");
                         return false;
                       }
                       
                       cpf = remove(cpf, ".");
                       cpf = remove(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"){
                          window.alert("CPF inválido. Tente novamente.");
						  document.formCalc.cpfsegurado.focus();
                          return false;
                       }
                    
                       soma = 0;
                       for(i = 0; i < 9; i++)
                         soma += parseInt(cpf.charAt(i)) * (10 - i);
                       resto = 11 - (soma % 11);
                       if(resto == 10 || resto == 11)
                         resto = 0;
                       if(resto != parseInt(cpf.charAt(9))){
                         window.alert("CPF inválido. Tente novamente.");
						 document.formCalc.cpfsegurado.focus();
                         return false;
                       }
                       soma = 0;
                       for(i = 0; i < 10; i ++)
                         soma += parseInt(cpf.charAt(i)) * (11 - i);
                       resto = 11 - (soma % 11);
                       if(resto == 10 || resto == 11)
                         resto = 0;
                       if(resto != parseInt(cpf.charAt(10))){
                         window.alert("CPF inválido. Tente novamente.");
						 document.formCalc.cpfsegurado.focus();
                         return false;
                       }
                       return true;
                     }
                     
                     function remove(str, sub) {
                       i = str.indexOf(sub);
                       r = "";
                       if (i == -1) return str;
                       r += str.substring(0,i) + remove(str.substring(i + sub.length), sub);
                       return r;
                     }
					 
       function validaCPFCALCULOCORRETOR(){
                       var cpf = document.formCalc.cpfcondutor.value;
                       var filtro = /^\d{3}.\d{3}.\d{3}-\d{2}$/i;
                       if(!filtro.test(cpf)){
                         window.alert("CPF inválido. Tente novamente.");
                         return false;
                       }
                       
                       cpf = removecondutor(cpf, ".");
                       cpf = removecondutor(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"){
                          window.alert("CPF inválido. Tente novamente.");
						  document.formCalc.cpfcondutor.focus();
                          return false;
                       }
                    
                       soma = 0;
                       for(i = 0; i < 9; i++)
                         soma += parseInt(cpf.charAt(i)) * (10 - i);
                       resto = 11 - (soma % 11);
                       if(resto == 10 || resto == 11)
                         resto = 0;
                       if(resto != parseInt(cpf.charAt(9))){
                         window.alert("CPF inválido. Tente novamente.");
						 document.formCalc.cpfcondutor.focus();
                         return false;
                       }
                       soma = 0;
                       for(i = 0; i < 10; i ++)
                         soma += parseInt(cpf.charAt(i)) * (11 - i);
                       resto = 11 - (soma % 11);
                       if(resto == 10 || resto == 11)
                         resto = 0;
                       if(resto != parseInt(cpf.charAt(10))){
                         window.alert("CPF inválido. Tente novamente.");
						 document.formCalc.cpfcondutor.focus();
                         return false;
                       }
                       return true;
                     }
                     
                     function removecondutor(str, sub) {
                       i = str.indexOf(sub);
                       r = "";
                       if (i == -1) return str;
                       r += str.substring(0,i) + removecondutor(str.substring(i + sub.length), sub);
                       return r;
                     }	
					 
					 
		       function validaCPFSINISTROTERCEIRO(){
                       var cpf = document.formSINISTROTERCEIRO.cpfsegurado.value;
                       var filtro = /^\d{3}.\d{3}.\d{3}-\d{2}$/i;
                       if(!filtro.test(cpf)){
                         //window.alert("CPF inválido. Tente novamente.");
                         return false;
                       }
                       
                       cpf = removeSINISTROTERCEIRO(cpf, ".");
                       cpf = removeSINISTROTERCEIRO(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"){
                          window.alert("CPF inválido. Tente novamente.");
						  document.formCalc.cpfsegurado.focus();
                          return false;
                       }
                    
                       soma = 0;
                       for(i = 0; i < 9; i++)
                         soma += parseInt(cpf.charAt(i)) * (10 - i);
                       resto = 11 - (soma % 11);
                       if(resto == 10 || resto == 11)
                         resto = 0;
                       if(resto != parseInt(cpf.charAt(9))){
                         window.alert("CPF inválido. Tente novamente.");
						 document.formCalc.cpfsegurado.focus();
                         return false;
                       }
                       soma = 0;
                       for(i = 0; i < 10; i ++)
                         soma += parseInt(cpf.charAt(i)) * (11 - i);
                       resto = 11 - (soma % 11);
                       if(resto == 10 || resto == 11)
                         resto = 0;
                       if(resto != parseInt(cpf.charAt(10))){
                         window.alert("CPF inválido. Tente novamente.");
						 document.formCalc.cpfsegurado.focus();
                         return false;
                       }
                       return true;
                     }
                     
                     function removeSINISTROTERCEIRO(str, sub) {
                       i = str.indexOf(sub);
                       r = "";
                       if (i == -1) return str;
                       r += str.substring(0,i) + removeSINISTROTERCEIRO(str.substring(i + sub.length), sub);
                       return r;
                     }
			 
					 				 
					 
