// JavaScript Document
function validateForm() 
{
 var f_valid=true
 with (document.register_online)
 {
	  
  if (f_firstname.value=="" && f_valid)
  {
    f_valid=false
    alert("You have not entered the Birthday Child's First Name.\nPlease Enter the First Name and resubmit.")
    f_firstname.focus();
	return false;
  }
  
   if (f_lastname.value=="" && f_valid)
  {
    f_valid=false
    alert("You have not entered Birthday Child's Surname.\nPlease Enter the Surname and resubmit.")
    f_lastname.focus();
	return false;
  }
  
    if (f_sex.value=="0" && f_valid)
  {
    f_valid=false
    alert("You have not entered the sex of the child.\nPlease Use the Drop Down Menu and select the child's sex and resubmit.")
    f_sex.focus();
	return false;
  }
  
     if (f_dob.value=="" && f_valid)
  {
    f_valid=false
    alert("You have not entered the Date Of Birth.\nPlease Enter the Date of Birth and resubmit.")
    f_dob.focus();
	return false;
  }
  
      if (f_age.value=="" && f_valid)
  {
    f_valid=false
    alert("You have not entered the Age Turning On Birthday.\nPlease Enter the age and resubmit.")
    f_age.focus();
	return false;
  }
  
    if (f_firstname2.value=="" && f_valid)
  {
    f_valid=false
    alert("You have not entered your First Name.\nPlease Enter your First Name and resubmit.")
    f_firstname2.focus();
	return false;
  }
  
   if (f_lastname2.value=="" && f_valid)
  {
    f_valid=false
    alert("You have not entered your Surname.\nPlease Enter your Surname and resubmit.")
    f_lastname2.focus();
	return false;
  }
  
  var foundAt = f_email.value.indexOf("@",0)
  if (foundAt < 1 && f_valid)
  {
    f_valid = false
    alert ("You have not entered a valid Email Address.\nPlease Enter your Email Address and resubmit.")
    f_email.focus();
	return false;
  }
  
   if (f_homephone.value=="" && f_valid)
  {
    f_valid=false
    alert("You have not entered your Home Phone.\nPlease Enter your Home Phone and resubmit.")
    f_homephone.focus();
	return false;
  }  
  
   if (f_guests.value=="" && f_valid)
  {
    f_valid=false
    alert("You have not entered the Approximate Number Of Guests.\nPlease Enter an Approximate Number and resubmit.")
    f_guests.focus();
	return false;
  }  
  
  if (f_day.value=="0" && f_valid)
  {
    f_valid=false
    alert("You have not entered a Booking Day.\nPlease Use the Drop Down Menu and select a Booking Day and resubmit.")
    f_day.focus();
	return false;
  }
  
  
     if (f_date.value=="" && f_valid)
  {
    f_valid=false
    alert("You have not entered a Booking Date.\nPlease Enter a Booking Date and resubmit.")
    f_date.focus();
	return false;
  }  
  
  
	if (f_time.value=="0" && f_valid)
  {
    f_valid=false
    alert("You have not entered a Session Preference.\nPlease Use the Drop Down Menu and select a Session Preference and resubmit.")
    f_time.focus();
	return false;
  }  
  
  	if (f_sport.value=="0" && f_valid)
  {
    f_valid=false
    alert("You have not entered a Sport Preference 1.\nPlease Use the Drop Down Menu and select a Sport Preference and resubmit.")
    f_time.focus();
	return false;
  }  
  
  	if (f_sport2.value=="0" && f_valid)
  {
    f_valid=false
    alert("You have not entered a Sport Preference 2.\nPlease Use the Drop Down Menu and select a Sport Preference and resubmit.")
    f_time.focus();
	return false;
  }   
  
  
  if (f_hear.value=="0" && f_valid)
  {
    f_valid=false
    alert("You have not entered How Did You Hear About Us.\nPlease Use the Drop Down Menu and select How Did You Hear About Us and resubmit.")
    f_hear.focus();
	return false;
  }
  

	if (confirm("\n Please ensure that all details have been entered correctly. \Press Ok to submit this form or Press Cancel to abort."))
	{
	alert("\nYour submission will now be sent.");
	f_valid==true;
	submit()
	}
	else
	{
	alert("\n You have chosen to abort the submission.");
	f_valid==false
	}
  

 }
}