function validateForm() 
{
 var okSoFar=true
 with (document.phpformmailer)
 {
  var foundAt = email.value.indexOf("@",0)
  if (foundAt < 1 && okSoFar)
  {
    okSoFar = false
    alert ("Please enter a valid email address.")
    email.focus()
  }
  var e1 = email.value
  var e2 = email2.value
  if (!(e1==e2) && okSoFar)
  {
    okSoFar = false
    alert ("The email addresses do not match. Please re-enter.")
    email.focus()
  }

    if (name.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter your name.")
    name.focus()
  }
        if (thephone.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter your phone number.")
    thephone.focus()
  }
      if (eventdate.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter the event date.")
    eventdate.focus()
  }
      if (typeofevent.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter the type of event.")
    typeofevent.focus()
  }
  if (okSoFar==true)  submit();
 }
}