<!-- Web Programming (c)2006 Naoe Kiyomine at Na-Demo-Ya info@nademoya.biz -->


function ChangeDate(){
z = document.booking;
tday = new Date();

thisyear = tday.getFullYear();
thismonth = tday.getMonth();
thisday = tday.getDate();

//Set Arrival Day

z.ArrivalDay07.selectedIndex = thisday-1;

//Set ArrivalMonth08

z.ArrivalMonth08.selectedIndex = thismonth;

//Set ArrivalYear09

z.ArrivalYear09.options[0].text = thisyear;
z.ArrivalYear09.options[1].text = thisyear+1;
z.ArrivalYear09.options[2].text = thisyear+2;
z.ArrivalYear09.options[0].value = thisyear;
z.ArrivalYear09.options[1].value = thisyear+1;
z.ArrivalYear09.options[2].value = thisyear+2;


//Set DepartureDay10

z.DepartureDay10.selectedIndex = thisday-1;

//Set DepartureMonth11

z.DepartureMonth11.selectedIndex = thismonth;

//Set DepartureYear12

z.DepartureYear12.options[0].text = thisyear;
z.DepartureYear12.options[1].text = thisyear+1;
z.DepartureYear12.options[2].text = thisyear+2;
z.DepartureYear12.options[0].value = thisyear;
z.DepartureYear12.options[1].value = thisyear+1;
z.DepartureYear12.options[2].value = thisyear+2;

}


/* Form Check for Booking Form */
function FormCheck()
{
	var z = document.booking;

	if (z.Name01.value.length > 25)
		{
		alert("You have entered too many characters for your Name!  You need fewer characters before I will submit this form.");
		z.Name01.focus();return false;
		}

	if (z.Name01.value=="")
		{
		alert("You have forgotten to fill in your name!");
		z.Name01.focus();return false;
		}

	if (z.Email05.value=="" && z.Fax04.value=="" && z.Phone03.value=="" && z.Address02.value=="")
		{
		alert("You must provide us with some contact details!");
		z.Email05.focus();return false;
		}

	//checkEmail = /.+@.+\..+/;
	var regexp = new RegExp(".+@.+\..+")
	var Email = z.Email05.value;

	if (Email!="" && Email.indexOf(" ",0)!=-1)
		{
		alert("Email address is not valid!");
		z.Email05.focus();return false;
		}
	if (Email!="" && (!(Email.match(regexp)) || Email.length < 6))
		{
		alert("Email address is not valid!");
		z.Email05.focus();return false;
		}

        if (!parseInt(z.People06.value)) 
		{
		alert("How many people?");
		z.People06.focus();return false;
		}
//	if (z.People06.value=="") 
//		{
//		alert("How many people?");
//		z.People06.focus();return false;
//		}

	var d1 = new Date(z.ArrivalYear09.value,z.ArrivalMonth08.value,z.ArrivalDay07.value);
	var d2 = new Date(z.DepartureYear12.value,z.DepartureMonth11.value,z.DepartureDay10.value);

tday = new Date();

thisyear = tday.getFullYear();
thismonth = tday.getMonth()+1;
thisday = tday.getDate();

	var d3 = new Date(thisyear,thismonth,thisday);
	
	if((d2<=d1)||(d1<d3)||(d2<d3)){
		alert("Please re-enter dates");
		z.ArrivalDay07.focus();return false;
	}
}

