// JavaScript Document
function validatemail(){ 
    //validate the first name 
    if (document.dabblePageForm.w141140.value.length<2){ 
       alert("Your First Name is necesary") 
       document.dabblePageForm.w141140.focus();
	   document.dabblePageForm.w141140.value="";
	   document.dabblePageForm.w141140.style.borderColor = "#C40000";
       return 0; 
    }
	
	//validate the last name
	 if (document.dabblePageForm.w141136.value.length<2){ 
       alert("Your Last Name is necesary") 
       document.dabblePageForm.w141136.focus();
	   document.dabblePageForm.w141136.value="";
	   document.dabblePageForm.w141136.style.borderColor = "#C40000";
       return 0; 
    }

    //valido the email 	
	if ((document.dabblePageForm.w141180.value.indexOf ('@', 0) == -1)||(document.dabblePageForm.w141180.value.length < 5)) {
	alert("Write the correct e-mail");
	document.dabblePageForm.w141180.focus();
	document.dabblePageForm.w141180.value="";
	document.dabblePageForm.w141180.style.borderColor = "#C40000";
	return 0;
	}
	
	if(document.dabblePageForm.w141146.value.length < 10){
	alert("Please enter your phone number, for example: 9536846987 (10 numbers as minimum)");
	document.dabblePageForm.w141146.focus();
	document.dabblePageForm.w141146.value="";
	document.dabblePageForm.w141146.style.borderColor = "#C40000";
	return 0;
	}
	
	if(document.dabblePageForm.w141280.value.length < 3){
	alert("Please, insert your tour name");
	document.dabblePageForm.w141280.focus();
	document.dabblePageForm.w141280.value="";
	document.dabblePageForm.w141280.style.borderColor = "#C40000";
	return 0;
	}
	
	var checkOK = "0123456789" + "/";
	var checkStr = document.dabblePageForm.w141142.value;
	var allValid = true;
	for (i = 0; i < checkStr.length; i++) {
	ch = checkStr.charAt(i);
	for (j = 0; j < checkOK.length; j++)
	if (ch == checkOK.charAt(j))
	break;
	if (j == checkOK.length) {
	allValid = false;
	break;
	}
	}
	if ((!allValid)||(document.dabblePageForm.w141142.value.length < 10)) {
	alert("Please, the correct form is for example: 05/20/2009");
	document.dabblePageForm.w141142.value="";
	document.dabblePageForm.w141142.focus();
	document.dabblePageForm.w141142.style.borderColor = "#C40000";
	return 0;
	}

    //el formulario se envia      
    document.dabblePageForm.submit();
} 

///////////////////////////////////////////////////-----------------------------------------------------------------------------------

function validatemailSpecials(){ 
    //validate the first name 
    if (document.dabblePageForm.w141140.value.length<2){ 
       alert("Your First Name is necesary") 
       document.dabblePageForm.w141140.focus();
	   document.dabblePageForm.w141140.value="";
	   document.dabblePageForm.w141140.style.borderColor = "#C40000";
       return 0; 
    }
	
	//validate the last name
	 if (document.dabblePageForm.w141136.value.length<2){ 
       alert("Your Last Name is necesary") 
       document.dabblePageForm.w141136.focus();
	   document.dabblePageForm.w141136.value="";
	   document.dabblePageForm.w141136.style.borderColor = "#C40000";
       return 0; 
    }

    //valido the email 	
	if ((document.dabblePageForm.w141180.value.indexOf ('@', 0) == -1)||(document.dabblePageForm.w141180.value.length < 5)) {
	alert("Write the correct e-mail");
	document.dabblePageForm.w141180.focus();
	document.dabblePageForm.w141180.value="";
	document.dabblePageForm.w141180.style.borderColor = "#C40000";
	return 0;
	}
	
	if(document.dabblePageForm.w141146.value.length < 10){
	alert("Please enter your phone number, for example: 9536846987 (10 numbers as minimum)");
	document.dabblePageForm.w141146.focus();
	document.dabblePageForm.w141146.value="";
	document.dabblePageForm.w141146.style.borderColor = "#C40000";
	return 0;
	}
	
	if (document.dabblePageForm.intflight.value.length<1){ 
       alert("Please, we need your Departing Airport") 
       document.dabblePageForm.intflight.focus();
	   document.dabblePageForm.intflight.value="";
	   document.dabblePageForm.intflight.style.borderColor = "#C40000";
       return 0; 
    }
	
	if(document.dabblePageForm.w141280.value.length < 3){
	alert("Please, insert your tour name");
	document.dabblePageForm.w141280.focus();
	document.dabblePageForm.w141280.value="";
	document.dabblePageForm.w141280.style.borderColor = "#C40000";
	return 0;
	}
	
	var checkOK = "0123456789" + "/";
	var checkStr = document.dabblePageForm.w141142.value;
	var allValid = true;
	for (i = 0; i < checkStr.length; i++) {
	ch = checkStr.charAt(i);
	for (j = 0; j < checkOK.length; j++)
	if (ch == checkOK.charAt(j))
	break;
	if (j == checkOK.length) {
	allValid = false;
	break;
	}
	}
	if ((!allValid)||(document.dabblePageForm.w141142.value.length < 10)) {
	alert("Please, the correct form is for example: 05/20/2009");
	document.dabblePageForm.w141142.value="";
	document.dabblePageForm.w141142.focus();
	document.dabblePageForm.w141142.style.borderColor = "#C40000";
	return 0;
	}

    //el formulario se envia      
    document.dabblePageForm.submit();
} 