
function 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 == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }
  if (theForm.Email.value != "")
  {
    var emailStr = theForm.Email.value
    var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
    var matchArray = emailStr.match(emailPat);
    if (matchArray == null) {
    alert("Your email address seems incorrect.  Please try again (check the '@' and '.'s in the email address)");
    theForm.Email.focus();
    return false;
    }
  }

  
  if (theForm.Phone.value == '' || isNaN(theForm.Phone.value)) {
   alert('You must enter a valid telephone (numbers only - No spaces or dashes!)');
   theForm.Phone.focus();
   return(false);
  } 

 
  if (theForm.Topic.value == "")
  {
    alert("Please enter a subject for the \"Topic\" field.");
    theForm.Topic.focus();
    return (false);
  }   



  if (theForm.Message.value == "")
  {
    alert("Please enter a message for the \"Message\" field.");
    theForm.Message.focus();
    return (false);
  }
 
  return (true);
}
