/*Form validations*/

function blank(txt_box)
{
if(txt_box.value!="")
 {
  txt_box.value="";
 }
}
function fill(txt_box)
{
 
 if(txt_box.value=="")
  {
 	if(txt_box.name=='name')
	 {
	 txt_box.value="Your Name";
	 }
	if(txt_box.name=='email')
	 {
	 txt_box.value="Your Email";
	 }
	if(txt_box.name=='phone')
	 {
	 txt_box.value="Your Phone";
	 }
	if(txt_box.name=='themessage')
	 {
	 txt_box.value="Message";
	 }

 }
}
function validateForm()
{
 var okSoFar=true
 with (document.phpformmailer)
 {
  var foundAt = email.value.indexOf("@",0)
  if (name.value=="" && okSoFar)
  {
	okSoFar=false
	alert("Please enter your name.")
	name.focus()
  }
  if (foundAt < 1 && okSoFar)
  {
	okSoFar = false
	alert ("Please enter a valid email address.")
	email.focus()
  }
    if (phone.value=="" && okSoFar)
  {
	okSoFar=false
	alert("Please enter the phone number.")
	phone.focus()
  }
  if (relates.value=="0" && okSoFar)
  {
	okSoFar=false
	alert("Please select the nature of your enquiry.")
	relates.focus()
  }
  if (themessage.value=="" && okSoFar)
  {
	okSoFar=false
	alert("Please enter the details for your enquiry.")
	themessage.focus()
  }
  if (okSoFar==true)  submit();
 }
}