<!--
function MasterFormValidate(theForm)
{
	var errorDesc = "";

   		if (theForm.dd.value == "")
  		{
    		theForm.dd.focus();
			errorDesc +="DOB dd\n";
  		}

   		if (theForm.mm.value == "")
  		{
    		theForm.mm.focus();
			errorDesc +="DOB mm\n";
  		}

   		if (theForm.yyyy.value == "")
  		{
    		theForm.yyyy.focus();
			errorDesc +="DOB yyyy\n";
  		}


   		if (theForm.t4.selectedIndex == 0)
  		{
    		theForm.t4.focus();
			errorDesc +="Where did you hear about blue driving academy\n";
  		}

   		if (theForm.t5.value == "")
  		{
    		theForm.t5.focus();
			errorDesc +="Your Location\n";
  		}

   		if (theForm.t6.value == "")
  		{
    		theForm.t6.focus();
			errorDesc +="Your Name\n";
  		}

               if (theForm.t11.value == "")
               {
               theForm.t11.focus();
               errorDesc +="Poscode\n";
               }
              else
               {
                  if (isValidPostcode(theForm.t11.value) == false)
                   {
                     theForm.t11.focus();
                     errorDesc +="Invalid Poscode\n"
                   }
                  else
                  {
                 //alert(formatPostcode(theForm.t8.value));
                 theForm.t11.value =(formatPostcode(theForm.t11.value));
                  }
               }

   		if (theForm.t14.value == "")
  		{
    		theForm.t14.focus();
			errorDesc +="Email\n";
  		}
  		else
  		{

                    var email = document.getElementById('emailaddress');
                    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
                    if (!filter.test(email.value)) {
                    theForm.t14.focus();
			errorDesc +="Invalid Email Address\n";
  		 }
  		}

   		if (theForm.t15.value !== theForm.t14.value)
  		{
    		theForm.t15.focus();
			errorDesc +="Email does not Re-typed Email\n";
  		}

	if (errorDesc == "")
  		{
			return (true);
  		}
	else
  		{
			alert("There are problem(s) with your submission: you have missing inputs:\n\n" + errorDesc);
			errorDesc = "";
			return (false);
  		}

}

//-->
