function checkform ( form )
{

  if (!/^([a-zA-Z\s\.'-]+)$/.test(form.firstname.value))
  {
    alert("Please use alphanumeric characters (plus spaces), full stops, hyphens (-) and apostrophes only in your first name.");
    form.firstname.focus();
    return false ;
  }

  if (!/^([a-zA-Z\s\.'-]+)$/.test(form.surname.value))
  {
    alert("Please use alphanumeric characters (plus spaces), full stops, hyphens (-) and apostrophes only in your surname.");
    form.surname.focus();
    return false ;
  }

  function validateEmail(email)
  {
  var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
  return email.match(re)
  }

  if(!validateEmail(form.email.value))
  {
    alert("Your email address appears to be invalid.");
    form.email.focus();
    return false ;
  }

  /* REMOVED AT JANET'S REQUEST
  if (!/^5[0-9]{4}$/.test(form.card.value))
  {
    alert("The first 5 digits of your MasterCard card number appear to be invalid.");
    form.card.focus();
    return false ;
  }
  */

  if (!/^([a-zA-Z0-9\s\.'-]{9})$/.test(form.reference.value))
  {
    alert("Your Cineworld booking reference appears to be incorrect.");
    form.reference.focus();
    return false ;
  }
  
  if (!/^([a-zA-Z0-9]{5})$/.test(form.captcha.value))
  {
    alert("Your verification word appears to be incorrect.");
    form.captcha.focus();
    return false ;
  }

  if (!form.terms.checked) {
    alert ("You must agree to our Terms and Conditions in order to participate.");
    form.terms.focus();
    return false;
  }

  return true;
}
