function validateForm() 
{
 var okSoFar=true
 with (document.phpformmailer)

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


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

  if (select.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter your subject.")
    select.focus()
  }
  
if (textbox.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter your text.")
    textbox.focus()
  }
  if (okSoFar==true)  submit();
 }
}
