function isEmail (s)
{     
    // is s whitespace?
    // if (ContainsWhitespace(s)) return false;
    
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}

function Form_Validator(theForm)
{

  if (theForm.FULL_NAME.value == "") {  alert("Please enter your full name");   theForm.FULL_NAME.focus();   return (false); }
  if (theForm.TELEPHONE.value == "") {  alert("Please enter your telephone number");   theForm.TELEPHONE.focus(); return (false); }
  if (theForm.FAX.value == "") {  alert("Please enter your fax number");   theForm.FAX.focus(); return (false); }
  if (theForm.EMAIL.value == "") {  alert("Please enter your email address");   theForm.EMAIL.focus(); return (false); }
  if (theForm.COLLECTION.value == "") {  alert("Please enter the collection point");   theForm.COLLECTION.focus(); return (false); }
  if (theForm.DESTINATION.value == "") {  alert("Please enter the drop-off point");   theForm.DESTINATION.focus(); return (false); }
  if (theForm.DATES_TIMES.value == "") {  alert("Please enter the dates and times");   theForm.DATES_TIMES.focus(); return (false); }
  if (theForm.VEHICLE_TYPE.value == "") {  alert("Please enter the type of vehicle required");   theForm.VEHICLE_TYPE.focus(); return (false); }
  if (theForm.FURTHER_DETAILS.value == "") {  alert("Please enter any further details");   theForm.FURTHER_DETAILS.focus(); return (false); }
  if (theForm.REQUEST_INFO_PRICE_LIST.value == "") {  alert("Please enter whether you require further into or a price list");   theForm.REQUEST_INFO_PRICE_LIST.focus(); return (false); }
  if (theForm.ENQUIRY_SOURCE.value == "") {  alert("Please enter how you found out about Le Tour");   theForm.ENQUIRY_SOURCE.focus(); return (false); }

  if  ((theForm.EMAIL.value != "") && !isEmail(theForm.EMAIL.value) )
  {
    alert("Please enter a valid email address");
    theForm.EMAIL.focus();
    return (false);
  }
 
    return (true);
}