function FormValidator (emailStr) {
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars + '+'
var word="(" + atom + "|" + quotedUser + ")"
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
var matchArray=emailStr.match(emailPat)

if (matchArray==null) {
	alert("Sorry, please check your Email address. It may be missing, or contain incorrect characters, or it has too many or too few needed characters (check for @ and .'s). I cannot send you a reply without a valid Email address");
  emailform.email.focus();
	return false
}
var user=matchArray[1]
var domain=matchArray[2]

if (user.match(userPat)==null) {
    alert("Sorry, please check the first part of your Email address. I am having trouble with the way it is typed.");
  emailform.email.focus();
    return false
}

var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        alert("Sorry, please check the middle portion of your E mail address. I am having trouble with the way it is typed. It should match the name of your Internet service provider or web host.");
  emailform.email.focus();
		return false
	    }
    }
    return true
}

var domainArray=domain.match(domainPat)
if (domainArray==null) {
	alert("Sorry, please check the last part of your Email address. I am having trouble with the way it is typed.");
  emailform.email.focus();
    return false
}

var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   alert("Sorry, please check the last part of your E mail address. I am having trouble with the way it is typed. Your address should end in a three-letter domain such as com, net or org, or a two letter country code such as cc, ca or uk.")
   return false
}

if (len<2) {
   var errStr="Sorry, please check your E mail address. I am having trouble with the way it is typed. Your address is missing the name of your Internet service provider or web host such as in hotmail, yahoo, or earthlink!"
   alert(errStr);
  emailform.email.focus();
   return false
}

if (emailform.first.value == "")
 {
  alert("Please enter your first name in the \"First Name\" field.");
  emailform.first.focus();
  return (false);
 }

 if (emailform.last.value == "")
 {
  alert("Please enter your last name in the \"Last Name\" field.");
  emailform.last.focus();
  return (false);
 }
 
 if (emailform.company.value == "")
 {
  alert("Please enter your Company Name in the \"Company Name\" field.");
  emailform.company.focus();
  return (false);
 }

 if (emailform.business.value == "")
 {
  alert("Please enter your type of business in the \"Type of Business\" field.");
  emailform.business.focus();
  return (false);
 }
 
  if (emailform.employees.value == "")
 {
  alert("Please enter the number of employees in your company in the \"Number of Employees\" field.");
  emailform.employees.focus();
  return (false);
 }
 
  if (emailform.telephone.value == "")
 {
  alert("Please enter your telephone number in the \"Telephone\" field.");
  emailform.telephone.focus();
  return (false);
 }
 
  if (emailform.source.value == "")
 {
  alert("Please let us know how you discovered our web site in the \"How did you hear about us?\" field.");
  emailform.source.focus();
  return (false);
 }
 

 return (true);
}
