<!-- hide JS code
 var justValidating = true
 function validateForm(form)  // validate form data
  {

	
if (form.firstname){
 if (!validateFirstName(form.firstname.value))  // first name valid?
    {
    form.firstname.focus()
    return false
    }
}
	
if (form.lastname){
 if (!validateLastName(form.lastname.value))  //  last name valid?
    {
    form.lastname.focus()
    return false
    }
}

if (form.email){
  if (!validateEMail(form.email.value))   // email valid?
   {
    form.email.focus()
    return false
    }
}

if (form.region){
 if (!validateregion(form.region.value))  //   region valid?
    {
    form.region.focus()
    return false
    }
}

if (form.lea){
 if (!validatelea(form.lea.value))  //  lea valid?
    {
    form.lea.focus()
    return false
    }
}

if (form.school){
 if (!validateschool(form.school.value))  //  school valid?
    {
    form.school.focus()
    return false
    }
}

if (form.schooladdress){
 if (!validateschooladdress(form.schooladdress.value))  //  schooladdress valid?
    {
    form.schooladdress.focus()
    return false
    }
}

if (form.schoolpostcode){
 if (!validateschoolpostcode(form.schoolpostcode.value))  //  schoolpostcode valid?
    {
    form.schoolpostcode.focus()
    return false
    }
}

if (form.jobposition){
 if (!validatejobposition(form.jobposition.value))  //  position valid?
    {
    form.jobposition.focus()
    return false
    }
}

if (form.phone){
 if (!validatePhone(form.phone.value))  //  phone no valid?
    {
    form.phone.focus()
    return false
    }
}

} 
 
    
function validateFirstName(firstname)
  {
  if (isBlank(firstname))               // first name field blank?
    {
    alert("Enter your first name, please")
    return false
    }
  return true
  }
    
function validatePhone(phone)
  {
  if (isBlank(phone))               // phone no field blank?
    {
    alert("Enter your contact telephone number, please")
    return false
    }
  return true
  }  
  
function isBlank(testStr)
  {
  if (testStr.length == 0)                     // nothing entered?
    return true
  for (var i = 0; i <= testStr.length-1; i++)  // all spaces?
    if (testStr.charAt(i) != " ")
      return false
  return true
  }
  
function validateLastName(lastname)
  {
  if (isBlank(lastname))               // last name field blank?
    {
    alert("Enter your last name, please")
    return false
    }
  return true
  }
	
function validateschooladdress(schooladdress)
  {
  if (isBlank(schooladdress))               // schooladdress field blank?
    {
    alert("Enter the address of your school or college, please")
    return false
    }
  return true
  }		
  
function validateschoolpostcode(schoolpostcode)
  {
  if (isBlank(schoolpostcode))               // schoolpostcode field blank?
    {
    alert("Enter the postcode of your school or college, please")
    return false
    }
  return true
  }	  
	
function validateregion(region)
  {
  if (isBlank(region))              	 // region field blank?
    {
    alert("Enter the region of your school or college, please")
    return false
    }
  return true
  }	
	
function validatelea(lea)
  {
  if (isBlank(lea))              	 // lea field blank?
    {
    alert("Enter the area of your school or college, please")
    return false
    }
  return true
  }	  
    
function validatejobposition(jobposition)
  {
  if (isBlank(jobposition))              	 // position field blank?
    {
    alert("Enter your position, please")
    return false
    }
  return true
  }	
  
function validateschool(school)
  {
  if (isBlank(school))              	 // school field blank?
    {
    alert("Enter the name of your school or college, please")
    return false
    }
  return true
  }	  
  
function validateEMail(email)
  {
  if (isBlank(email))                       // email blank?
    {
    alert("Please enter your email address")
    return false
    }
  var atsignPos = email.indexOf("@", 0)     // check for @
  if (atsignPos == -1)	
    {
    alert("Enter a valid email address with an @, please!")
    return false
    }
  if (email.indexOf(".", atsignPos) == -1)  // check for . after @	
    {
    alert("Enter a valid email domain after the @, please!")
    return false
    }
  return true
  }  
		
// end JS hide -->