 function Validator(theForm)
 {
  // checks if the e-mail address is valid --([A-Za-z]\w*(\.[A-Za-z]\w*))
  var emailStr = theForm.email.value;
  var emailPat = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; 
  var matchArray = emailStr.match(emailPat); 
  if (matchArray == null)
  { 
      alert("Your e-mail address seems incorrect. Please try again (check the '@' and '.'s in the e-mail address)"); 
      return false; 
  } 
  /* make sure the IP address domain is valid 
  var IPArray = matchArray[2].match(/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/); 
 if (IPArray != null)
 { 
     for (var i=1;i<=4;i++) 
     { 
         if (IPArray[i]>255) 
         { 
             alert("Destination IP address is invalid!"); 
             return false; 
       } 
       } 
} */ 

  if (theForm.firstname.value == "")
  {
     alert("Please enter a value for the \"First Name\" field.");
     theForm.firstname.focus();
     return (false);
  }
  if (theForm.lastname.value == "")
  {
     alert("Please enter a value for the \"Last Name\" field.");
     theForm.lastname.focus();
     return (false);
  }
  if (theForm.title.selectedIndex == 0)
  {
     alert("Please select a value for the \"Title\" field.");
     theForm.title.focus();
     return (false);
  }  
  if (theForm.employer.value == "")
  {
     alert("Please enter a value for the \"Company Name\" field.");
     theForm.employer.focus();
     return (false);
  }  

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

  if (theForm.state.value == "")
  {
     alert("Please enter a value for the \"State\" field.");
     theForm.state.focus();
     return (false);
  }
  if (theForm.phone.value == "")
  {
     alert("Please enter a value for the \"Phone\" field.");
     theForm.phone.focus();
     return (false);
  }  
  
  if (theForm.email.value == "")
  {
     alert("Please enter a value for the \"E-mail\" field.");
     theForm.email.focus();
     return (false);
  }
  if (theForm.zip.value == "")
  {
    alert("Please enter a value for the \"Postal/ZIP Code\" field.");
    theForm.zip.focus();
    return (false);
  }
  
  if (theForm.country.value == "")
  {
    alert("Please enter a value for the \"Country\" field.");
    theForm.country.focus();
    return (false);
  }
  if (theForm.name.value == "")
  {
     alert("Please enter your name.");
     theForm.name.focus();
     return (false);
  }  
  if (theForm.employer2.value == "")
  {
     alert("Please enter your company name.");
     theForm.employer2.focus();
     return (false);
  }    
  if (theForm.phone2.value == "")
  {
     alert("Please enter your phone number.");
     theForm.phone2.focus();
     return (false);
  }  
  
  if (theForm.email2.value == "")
  {
     alert("Please enter your e-mail address.");
     theForm.email2.focus();
     return (false);
  }  
  return (true);
}