
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 messagestr = themessage.value
  var patt1 = /[<|>|URL|IMG]/g
 
  if (themessage.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter the details for your enquiry.")
    themessage.focus()
  }
 	
  if (messagestr.match(patt1) && okSoFar) {
	  
	  okSoFar=false
	  alert("Your message had bad characters or you're trying to spam me. Please remove them.")
	  themessage.focus()
  }

	  
  if (okSoFar==true) { document.phpformmailer.action="contact_process.php"; }
  else {  }
 }
}


