// JavaScript Document
function validateFormLabelsSIAC() {
var SIAC = "Requested hotel information: "
var NumbersOnly = /[0-9]/; // allow only numbers
var CheckPhone=document.myForm.Phone.value.replace(/[\(\)\.\-\ ]/g, '');
var CheckEmail =document.myForm.Email.value;
var emailFilter=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var rad_val2;
if(document.myForm.Groups.checked == true)
{rad_val2="Yes";}
var rad_val;
for (var i=0; i < document.myForm.Hotel.length; i++)
   {
   if (document.myForm.Hotel[i].checked)
      {
      var rad_val = document.myForm.Hotel[i].value;
      } 
   }

SIAC = SIAC + rad_val + " \n";
if(rad_val != "No"){SIAC = SIAC +  "Check in date: "   +  document.myForm.CheckInDate.value +  "\n Check out date: "   +  document.myForm.CheckOutDate.value + "\n No of Dates: " + document.myForm.Nights.value + "\n Part of Group; " + rad_val2;  }
document.myForm.comment.value = SIAC;
if (document.myForm.FirstName.value == ""){alert("Por favor, entre su nombre.");document.myForm.FirstName.focus();return false;}
if (document.myForm.LastName.value == ""){alert("Por favor, entre su apellido.");document.myForm.LastName.focus();return false;}
if (isNaN(parseInt(CheckPhone))){alert("Por favor, entre su numero de telefono.");document.myForm.Phone.focus();return false;}
if (!(emailFilter.test(CheckEmail))){alert("Por favor, entre su direccion de e-mail.");document.myForm.Email.focus();return false;}
if (document.myForm.Organization.value == ""){alert("Por favor, entre el nombre de su organizacion");document.myForm.Organization.focus();return false;}
if (document.myForm.Address.value == ""){alert("Por favor, entre su direccion.");document.myForm.Address.focus();return false;}
if (document.myForm.City.value == ""){alert("Por favor, entre su ciudad.");document.myForm.City.focus();return false;}
if (document.myForm.State.value == ""){alert("Por favor, entre su provincia.");document.myForm.State.focus();return false;}
if (document.myForm.Country.value == "00"){alert("Por favor, entre su pais.");document.myForm.Country.focus();return false;}

// validate Hotel radio buttons
myOption = -1;
for (i=myForm.Hotel.length-1; i > -1; i--) {
if (myForm.Hotel[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("ha de seleccionar si desea reservar una habitacion de hotel.");
return false;
}
// end validate Hotel radio buttons


// see if the select box exists/visible and if so add validation
if (document.getElementById('SpecifyLeadType').style.display == 'block')
	{
	//alert(document.myForm.SpecifyLeadType.value);
	if ((document.myForm.SpecifyLeadType.value == "") || (document.myForm.SpecifyLeadType.value == "Please specify" )){alert("Please specify how you heard about Picis");return false;}
	}

	else
{
	//alert('not visible');
}

}
