// JavaScript Document
function validate(){
var thisform=window.document.contact;
var name=thisform.name.value;
var phone=thisform.telephone.value;
var email=thisform.email.value;
var comments=thisform.comments.value;

if ((name=="")||(name.length<2)||(name==" ")){alert("Please enter your name."); document.contact.name.focus();  return false}
if (phone==""){alert("Please enter your contact number."); document.contact.telephone.focus();  return false}
if (phone.length<10){alert("Please enter your full contact number including 3 digit area code."); document.contact.telephone.focus();  return false}

var theat=email.indexOf("@")
var thedot=email.indexOf(".")
var aspace=email.indexOf(" ")

if (email==""){alert ("Please enter your email address for contact."); document.contact.email.focus(); return false}
else if (theat==0 || thedot==-1 || thedot==0 || thedot==email.length-1 || aspace>-1 || theat==email.length-1){alert ("Invalid Email address"); document.contact.email.focus(); return false}
else if (theat==-1){alert ("Your Email is missing an \"@\" sign"); document.contact.email.focus(); return false}



if ((comments=="")||(comments.length<5)||(comments==" ")){alert("Please enter your question\(s\) or comment\(s\)."); document.contact.comments.focus();  return false}

return true
}