var validator = new validate();

function FrontPage_Form1_Validator(theForm)
{

  if (theForm.Name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Email.value == "" || !validator.isValidEmail(theForm.Email.value))
  {
    alert("Please enter a valid value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }
  return (true);
}


function FrontPage_Form2_Validator(theForm)
{

  if (theForm.title1.value == "")
  {
    alert("Please enter a value for the \"title1\" field.");
    theForm.title1.focus();
    return (false);
  }

  if (theForm.title1.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"title1\" field.");
    theForm.title1.focus();
    return (false);
  }

  if (theForm.fname.value == "")
  {
    alert("Please enter a value for the \"fname\" field.");
    theForm.fname.focus();
    return (false);
  }

  if (theForm.lname.value == "")
  {
    alert("Please enter a value for the \"lname\" field.");
    theForm.lname.focus();
    return (false);
  }

  if (theForm.Address1.value == "")
  {
    alert("Please enter a value for the \"Address1\" field.");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.Address1.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Address1\" field.");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.PostCode.value == "" || !validator.isOnlyAlphaNumeric(theForm.PostCode.value,1))
  {
    alert("Please enter a valid value for the \"PostCode\" field.");
    theForm.PostCode.focus();
    return (false);
  }

  if (theForm.PostCode.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"PostCode\" field.");
    theForm.PostCode.focus();
    return (false);
  }

  if (theForm.Country.value == "")
  {
    alert("Please enter a value for the \"Country\" field.");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.Country.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Country\" field.");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.TelephoneDay.value == "")// || !validator.isOnlyNumeric(theForm.TelephoneDay.value)
  {
    alert("Please enter a value for the \"TelephoneDay\" field.");
    theForm.TelephoneDay.focus();
    return (false);
  }

  if (theForm.TelephoneEve.value != "")// && !validator.isOnlyNumeric(theForm.TelephoneEve.value)
  {
    alert("Please enter a value for the \"Evening/Weekend  \" field.");
    theForm.TelephoneEve.focus();
    return (false);
  }

  if (theForm.TelephoneMob.value != "")// && !validator.isOnlyNumeric(theForm.TelephoneMob.value)
  {
    alert("Please enter a value for the \"Mobile  \" field.");
    theForm.TelephoneMob.focus();
    return (false);
  }


  if (theForm.TelephoneDay.value.length < 10)// || !validator.isOnlyNumeric(theForm.TelephoneDay.value)
  {
    alert("Please enter at least 10 characters in the \"TelephoneDay\" field.");
    theForm.TelephoneDay.focus();
    return (false);
  }

  if (theForm.Email.value == ""  || !validator.isValidEmail(theForm.Email.value))
  {
    alert("Please enter a valid value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }
  return (true);
}
