// JavaScript Document
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false}
else {return true}
}
}

function validate_frmConfirmation(thisform)
{
with (thisform)
{
if (validate_required(name,"Please provide Crown Chauffeur Drive UK with your full name.")==false)
  {name.focus();return false}
  
	  if (validate_required(email,"Please enter your email address.")==false)
	  {email.focus();return false}
	  
	  if (validate_required(tel,"Please provide Crown Chauffeur Drive UK with a contact number.")==false)
	  {tel.focus();return false}
	  
	  if (validate_required(name2,"Please confirm the full name of the person we are collecting.")==false)
		  {name2.focus();return false}
		  
	  if (validate_required(placecollect,"Please enter the collection point.")==false)
		  {placecollect.focus();return false}
		  
	  if (validate_required(postcode,"Please enter a postcode to help Crown Chauffeur Drive UK locate the above address.")==false)
		  {postcode.focus();return false}
		  
	  if (datecollect.value == "DD/MM/YY") {alert("Please enter a valid collection date"); datecollect.focus; return false; }
		  
	  if (validate_required(destination,"Please enter your destination.")==false)
		  {destination.focus();return false}
		  
		if (validate_required(time,"IMPORTANT! What time are you looking to arrive at your destination?")==false)
		  {time.focus();return false}
		  
	  if (agree.checked == false) { alert("Please confirm you agree to our terms and conditions"); agree.focus(); return false; }
		  
}	
}
