// JavaScript Document
//From Notes
function checkform(){
var checkform = false;
if (document.Contact_Form.name.value!=="" && checkemail(document.Contact_Form.email)
 && document.Contact_Form.comments.value!=="")
{
checkform = true;
}
if (checkform==false) DisplayErrors();
return checkform;
} // checkform() function


function DisplayErrors()
{
   if (document.Contact_Form.name.value=="")
      alert("Please enter your name.");
   else if (!checkemail(document.Contact_Form.email))
      alert("Please enter a valid email address.")
   else if (document.Contact_Form.comments.value=="")
      alert("The Comments field is empty.  Please enter in a comment or a question.");
} // end DisplayErrors() function;


//Check Email Function
function checkemail(elm)
{
   var emailpattern = /^[a-zA-Z0-9\-\_\.]+\@[a-zA-Z0-9 \-]+\.([a-zA-Z]{2,4})$/;
   if (emailpattern.test(elm.value))
   {
      return true;
   }

   return false;
}
//End Check Email Function
