// JavaScript Document

function formCheck(){
	/*// Enter name of mandatory fields
	var fieldRequired = Array("FullName", "Telephone", "EmailAddress");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("First and Last Name", "Telephone Number", "Email Address");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";	
	var l_Msg = alertMsg.length;

	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";

				}
			}
		}
	}
	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}*/	
	valid = true;
	// valido el first name
	if (document.dabblePageForm.w141140.value.length < 2)
	{
	alert ("Your First Name is necessary");
	document.dabblePageForm.w141140.focus();
	document.dabblePageForm.w141140.value="";
	document.dabblePageForm.w141140.style.borderColor = "#C40000";
	valid = false;
	}
	
	//valido el last name
	else if (document.dabblePageForm.w141136.value.length < 2)
	{
	alert ("Your Last Name is necessary");
	document.dabblePageForm.w141136.focus();
	document.dabblePageForm.w141136.value="";
	document.dabblePageForm.w141136.style.borderColor = "#C40000";
	valid = false;
	}
	//valido el telefono
	else if(document.dabblePageForm.w141146.value.length < 10)
	{
	alert ("Your correct telephone is necessary");
	document.dabblePageForm.w141146.value="";
	document.dabblePageForm.w141146.focus();
	document.dabblePageForm.w141146.style.borderColor = "#C40000";
	valid = false;
	}
	
	//validar el email
	else 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";
	valid = false;
	}
	
	else if (document.dabblePageForm.w141168.value == "")
	{
	alert ("PLEASE INDICATE THE NUMBER OF PEOPLE TRAVELING");
	document.dabblePageForm.w141168.focus();
	document.dabblePageForm.w141168.value="";
	document.dabblePageForm.w141168.style.borderColor = "#C40000";
	valid = false;
	}
	
	return valid;
}

/* validando el contact con doble evento */

function ValidateContactUS(){
	
	var valid = true;	
	if (document.dabblePageForm.w141140.value.length < 2)
	{
	alert ("Your First Name is necessary");
	document.dabblePageForm.w141140.focus();
	document.dabblePageForm.w141140.value="";
	document.dabblePageForm.w141140.style.borderColor = "#C40000";
	valid = false;
	}
	
	else if (document.dabblePageForm.w141136.value.length < 2)
	{
	alert ("Your Last Name is necessary");
	document.dabblePageForm.w141136.focus();
	document.dabblePageForm.w141136.value="";
	document.dabblePageForm.w141136.style.borderColor = "#C40000";
	valid = false;
	}
	
	else 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";
	valid = false;
	}
	
	else if (document.dabblePageForm.w141280.value.length < 1)
	{
	alert ("PLEASE INDICATE THE TOUR OF YOUR INTEREST");
	document.dabblePageForm.w141280.focus();
	document.dabblePageForm.w141280.value="";
	document.dabblePageForm.w141280.style.borderColor = "#C40000";
	valid = false;
	}
	
	else if (document.dabblePageForm.w141168.value == "")
	{
	alert ("PLEASE INDICATE THE NUMBER OF PEOPLE TRAVELING");
	document.dabblePageForm.w141168.focus();
	document.dabblePageForm.w141168.value="";
	document.dabblePageForm.w141168.style.borderColor = "#C40000";
	valid = false;
	}
	
	return valid;
}
// -->

function validateDisclamer(){
	
	var valid = true;	
	
	if (document.DisclamerForm.Name.value.length < 2)
	{
	alert ("Your Full Name is necessary");
	document.DisclamerForm.Name.focus();
	document.DisclamerForm.Name.value="";
	document.DisclamerForm.Name.style.borderColor = "#C40000";
	valid = false;
	}
	
	else if(document.DisclamerForm.Phone.value.length < 10)
	{
	alert ("Please, enter your correct phone number, for example: 9536846987 (10 numbers as minimum)");
	document.DisclamerForm.Phone.value="";
	document.DisclamerForm.Phone.focus();
	document.DisclamerForm.Phone.style.borderColor = "#C40000";
	valid = false;
	}
	
	else if ((document.DisclamerForm.Email.value.indexOf ('@', 0) == -1)||(document.DisclamerForm.Email.value.length < 5)) {
	alert("Write the correct e-mail");
	document.DisclamerForm.Email.focus();
	document.DisclamerForm.Email.value="";
	document.DisclamerForm.Email.style.borderColor = "#C40000";
	valid = false;
	}
	
	else if(document.DisclamerForm.ReferenceBy.value == 0)
	{
	alert ("Please, choose your travel agent!");
	document.DisclamerForm.ReferenceBy.value = 0;
	document.DisclamerForm.ReferenceBy.focus();
	document.DisclamerForm.ReferenceBy.style.borderColor = "#C40000";
	valid = false;
	}
	
	else if(document.DisclamerForm.accept.checked == false)
	{
	alert ("Please, accept those terms and conditions");
	document.DisclamerForm.accept.value = 0;
	document.DisclamerForm.accept.focus();
	document.DisclamerForm.accept.style.borderColor = "#C40000";
	valid = false;
	}
	
	return valid;
}
