// 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 full name
	if (document.booking.FullName.value.length < 4)
	{
	alert ("Your First and Last Name is necessary");
	document.booking.FullName.focus();
	document.booking.FullName.value="";
	document.booking.FullName.style.borderColor = "#C40000";
	valid = false;
	}
	
	//valido el telefono
	else if(document.booking.Telephone.value.length < 5)
	{
	alert ("Your correct telephone is necessary");
	document.booking.Telephone.value="";
	document.booking.Telephone.focus();
	document.booking.Telephone.style.borderColor = "#C40000";
	valid = false;
	}
	
	//validar el email
	else if ((document.booking.EmailAddress.value.indexOf ('@', 0) == -1)||(document.booking.EmailAddress.value.length < 5)) {
	alert("Write the correct e-mail");
	document.booking.EmailAddress.focus();
	document.booking.EmailAddress.value="";
	document.booking.EmailAddress.style.borderColor = "#C40000";
	valid = false;
	}
	
	//validar information2 - pack o tour
	else if (document.booking.information2.value.length < 5){
	alert("Please, send me info about your Pack or your favorite Tour");
	document.booking.information2.focus();
	document.booking.information2.value="";
	document.booking.information2.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 ("\u00c9 necess\u00e1rio o primeiro nome");
	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 ("\u00c9 necess\u00e1rio o \u00faltimo nome");
	document.dabblePageForm.w141136.focus();
	document.dabblePageForm.w141136.value="";
	document.dabblePageForm.w141136.style.borderColor = "#C40000";
	valid = false;
	}
	
	else if(document.dabblePageForm.w141146.value.length < 10)
	{
	alert ("Por favor, insira seu telefone, exemplo: 1195825799 (no m\u00ednimo 10 algarismos)");
	document.dabblePageForm.w141146.value="";
	document.dabblePageForm.w141146.focus();
	document.dabblePageForm.w141146.style.borderColor = "#C40000";
	valid = false;
	}
	
	else if ((document.dabblePageForm.w141180.value.indexOf ('@', 0) == -1)||(document.dabblePageForm.w141180.value.length < 5)) {
	alert("Por favor, escreva corretamente seu 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 < 5)
	{
	alert ("INDIQUE FAVOR DO TOUR DE SEU INTERESSE");
	document.dabblePageForm.w141280.focus();
	document.dabblePageForm.w141280.value="";
	document.dabblePageForm.w141280.style.borderColor = "#C40000";
	valid = false;
	}
	
	return valid;
}
// -->