<!--

function validateForm()
{
 var error = 0;
 var msg = "ERROR IN FORM\nThe form cannot be processed as the following fields have not been completed:\n\n";
 var thisForm = document.bookingForm;

 if(thisForm.accomName.value == 'none')
 {
  msg += ">> Accommodation\n";
  error ++;
 }
 if(thisForm.title.value == 'none')
 {
  msg += ">> Title\n";
  error ++;
 }
 if(thisForm.name.value == '')
 {
  msg += ">> First Name\n";
  error ++;
 }
 if(thisForm.surname.value == '')
 {
  msg += ">> Last Name\n";
  error ++;
 }
 if(thisForm.email.value == '')
 {
  msg += ">> E-mail Address\n";
  error ++;
 }
  if(thisForm.phone.value == '')
 {
  msg += ">> Phone Number\n";
  error ++;
 }

if(error > 0)
 {
  msg += "\nPlease make the necessary corrections to the form and resubmit it.";
  alert(msg);
 }
 else
 {
  bookingPopup(
  	thisForm.accomName.value, 
	thisForm.title.value, 
	thisForm.name.value, 
	thisForm.surname.value,
	thisForm.email.value, 
	thisForm.phone.value, 
	thisForm.adults.value, 
	thisForm.children.value, 
	thisForm.numNights.value, 
	thisForm.beg_day.value, 
	thisForm.beg_month.value, 
	thisForm.beg_year.value, 
	thisForm.end_day.value, 
	thisForm.end_month.value, 
	thisForm.end_year.value, 
	thisForm.enquiry.value
	)
 } 
}

function bookingPopup(	
	accomName,
	title,
	name,
	surname,
	email,
	phone,
	adults,
	children,
	numNights,
	beg_day,
	beg_month,
	beg_year,
	end_day,
	end_month,
	end_year,
	enquiry
	)
{
	window.open("../php/book.php?accom="+accomName+"&title="+title+"&name="+name+"&surname="+surname+"&email="+email+"&phone="+phone+"&adults="+adults+"&children="+children+"&numNights="+numNights+"&beg_day="+beg_day+"&beg_month="+beg_month+"&beg_year="+beg_year+"&end_day="+end_day+"&end_month="+end_month+"&end_year="+end_year+"&enquiry="+enquiry,"", "width=300,height=300,scrollbars");
}


//-->