
function validateForm() 
{
 var okSoFar=true
 with (document.phpformmailer)
 {
  if (fname.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter your first name.")
    fname.focus()
  }

  if (lname.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter your last name.")
    lname.focus()
  }

  if (email.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter your email address.")
    email.focus()
  }
  
  var foundAt = email.value.indexOf("@",0)
  if (foundAt < 1 && okSoFar)
  {
    okSoFar = false
    alert ("Please enter a valid email address.")
    email.focus()
  }
  
  if (text.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter your message.")
    text.focus()
  }
  
  if (verifycode.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter Validation Code.")
    verifycode.focus()
  }
  if (okSoFar==true)  submit();
 }
}

