function ContactFormValidator(theForm)
{
  letterChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
  numberChars = "0123456789"
  specialChars = "!@#$^()-_+=,.<>?~:;|"
  emailChars = "@._-"
  emailNeeds = "@."
  if (theForm.fname.value.length < 1)
  {
    alert("Please enter your first name.")
    theForm.fname.focus()
    return false
  }
  if (theForm.lname.value.length < 1)
  {
    alert("Please enter your last name.")
    theForm.lname.focus()
    return false
  }
  if (theForm.email.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Email Address\" field.")
    theForm.email.focus()
    return (false)
  }
  if (theForm.email.value.length > 42)
  {
    alert("Please enter at most 42 characters in the \"Email Address\" field.")
    theForm.email.focus()
    return (false)
  }
  theseChars = letterChars + numberChars + emailChars
  for (i=0; i < theForm.email.value.length; i++) {
    myChar = theForm.email.value.charAt(i)
    if (theseChars.indexOf(myChar) < 0) {
      alert("Invalid special character in the \"Email Address\" field.")
      theForm.email.focus()
      return false
    }
  }
  for (i=0; i < emailNeeds.length; i++) {
    myChar = emailNeeds.charAt(i)
    if (theForm.email.value.indexOf(myChar) < 0) {
      alert("Please enter a valid \"Email Address\".")
      theForm.email.focus()
      return false
    }
  }
  if (theForm.subject.value.length < 1)
  {
    alert("Please enter a \"Subject\".")
    theForm.subject.focus()
    return false
  }
  if (theForm.subject.value.length > 30)
  {
    alert("Please use no more than 30 characters for the \"Subject\" field.")
    theForm.subject.focus()
    return false
  }
  if (theForm.message.value.length < 1)
  {
    alert("Please enter a \"Message\".")
    theForm.message.focus()
    return false
  }
  if (theForm.message.value.length > 2000)
  {
    alert("Please use no more than 2000 characters for the \"Message\" field.")
    theForm.subject.focus()
    return false
  }
  return true
}
