// JavaScript Document
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 ("Email addresses you entered do not match.  Please re-enter.")
    email2.focus()
  }
  if (phone.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter telephonic number.")
    phone.focus()
  }
  
  if (p_origin.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter the Product Origin.")
    p_origin.focus()
  }
  
  if (p_destination.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter the Product Destination.")
    p_destination.focus()
  }
  
  /*if (themessage.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter the details for your enquiry.")
    themessage.focus()
  }*/
  if (okSoFar==true)  
  {
   block_spam_bots.value=4*3;//spam bots currently can not read JavaScript, if could then they'd fail the maths!
   submit();                  // do check for updatea often at:  www.TheDemoSite.co.uk 
  } 
 }
}
