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>4) {
   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- or four-letter domain such as com, net, org, biz or info, or a two letter country code such as us, 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.sponsorship_amount.value == "")
 {
  alert("Please enter the amount of your sponsorship in the \"Amount $\" field.");
  emailform.sponsorship_amount.focus();
  return (false);
 }

  return (true);
}