// JavaScript Document

function Form_Validator_CVSubmit(theForm)
{

  if (theForm.surname.value == "")
  {
    alert("Please enter a value for the \"Surname\" field.");
    theForm.surname.focus();
    return (false);
  }

  if (theForm.forename.value == "")
  {
    alert("Please enter a value for the \"Forename\" field.");
    theForm.forename.focus();
    return (false);
  }
  var zToCheck;
  zToCheck = theForm.email.value;
  if (zToCheck.length < 7)
  {
    alert("An email address must be supplied. Please enter at least 7 character in the \"Contact E-mail\" field.");
    theForm.email.focus();
    return (false);
  }

  var zRegExp;
  zRegExp = "^[A-Za-z0-9_-]+[A-Za-z0-9_.-]*@[A-Za-z0-9]+[A-Za-z0-9_-]+[.][A-Za-z0-9_-]+[A-Za-z0-9_.-]*[A-Za-z0-9]+$";

  if (zToCheck.search(zRegExp) == -1)
  {
    alert("An email address must be supplied. Please enter a valid EMAIL ADDRESS in the \"Contact E-mail\" field.");
    theForm.email.focus();
    return (false);
  }

  if (theForm.fileCV.value == "")
  {
    alert("Please select your CV by clicking on the browse button.");
    theForm.fileCV.focus();
    return (false);
  }



  return (true);
}



function Form_Validator_JBE(theForm)
{

  var zToCheck;
  zToCheck = theForm.emailaddress.value;

  if (zToCheck == "")
  {
    alert("Please enter a value for the \"Your Email Address\" field.");
    theForm.emailaddress.focus();
    return (false);
  }

  if (zToCheck.length < 7)
  {
    alert("Please enter at least 7 characters in the \"Your Email Address\" field.");
    theForm.emailaddress.focus();
    return (false);
  }

  if (zToCheck.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Your Email Address\" field.");
    theForm.emailaddress.focus();
    return (false);
  }

  var zRegExp;
  zRegExp = "^[A-Za-z0-9_-]+[A-Za-z0-9_.-]*@[A-Za-z0-9]+[A-Za-z0-9_-]+[.][A-Za-z0-9_-]+[A-Za-z0-9_.-]*[A-Za-z0-9]+$";

  if (zToCheck.search(zRegExp) == -1)
  {
    alert("Please enter a valid EMAIL ADDRESS in the \"Your Email Address\" field.");
    theForm.emailaddress.focus();
    return (false);
  }
  return (true);
}

