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

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

  if (phone.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter your phone number.")
    phone.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 (message.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter your message.")
    message.focus()
  }

  if (verifycode.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter your Enter Validation Code.")
    verifycode.focus()
  }
  
  if (okSoFar==true) submit();
 }
}