// JavaScript Document
function validateForm() 
{
 var f_valid=true
 with (document.register_online)
 {
	 
  if (f_sport.value=="0" && f_valid)
  {
    f_valid=false
    alert("You have not entered your Sport.\nPlease Use the Drop Down Menu and select a Sport and resubmit.")
    f_sport.focus();
	return false;
  }
  
    if (f_teamtype.value=="0" && f_valid)
  {
    f_valid=false
    alert("You have not entered your Team Type.\nPlease Use the Drop Down Menu and select a Team Type and resubmit.")
    f_teamtype.focus();
	return false;
  }
  
      if (f_skill.value=="0" && f_valid)
  {
    f_valid=false
    alert("You have not entered your Skill Level.\nPlease Use the Drop Down Menu and select a Skill Level and resubmit.")
    f_skill.focus();
	return false;
  }
  
  if (f_firstname.value=="" && f_valid)
  {
    f_valid=false
    alert("You have not entered your First Name.\nPlease Enter your First Name and resubmit.")
    f_firstname.focus();
	return false;
  }
  
   if (f_lastname.value=="" && f_valid)
  {
    f_valid=false
    alert("You have not entered your Last Name.\nPlease Enter your Last Name and resubmit.")
    f_lastname.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_mobilephone.value=="" && f_valid)
  {
    f_valid=false
    alert("You have not entered your Mobile Phone.\nPlease Enter your Mobile Phone and resubmit.")
    f_mobilephone.focus();
	return false;
  }  
  
  if (f_day.value=="0" && f_valid)
  {
    f_valid=false
    alert("You have not entered your prefered Day To Play.\nPlease Use the Drop Down Menu and select your prefered Day to Play and resubmit.")
    f_day.focus();
	return false;
  }
  
	if (f_time.value=="0" && f_valid)
  {
    f_valid=false
    alert("You have not entered your Preferred Time To Play.\nPlease Use the Drop Down Menu and select your Preferred Time To Play 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 We all expect our opponents to turn up for a fixtured game and by entering this league our team understand that we have obligations to turn up or give 72 hours notice of forfeit. In the event of a forfeit we agree to pay a forfeit fee where we do not give at least 72 hours notice of our inability to play a fixtured game.Full game fees are to be paid prior to the team taking the court. Any team with outstanding fees will have ladder results withheld and will be ineligible for Playoffs.All leagues will be at least 15 rounds and may involve playing some game during the season on days other than the preferred option example Sunday \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
	}
  

 }
}