/*
   validation.js

   Form validation processing


*/

function validateEmailForm(emailform)
{

   var alertText = "You need to enter the following:  \n\n";
   var alertErr = "N";


   if (document.emailform.name.value=="")
   {
      alertText += "- Name \n";
      alertErr = "Y";
   }


   if (document.emailform.email.value=="")
   {
      alertText += "- Email \n";
      alertErr = "Y";
   }


   if (document.emailform.comments.value=="")
   {
      alertText += "- Your Question \n";
      alertErr = "Y";
   }


   if (alertErr=="Y")
   {
      alert(alertText);
      return false;
   }


   /* validation email format */

   var emailtest = document.emailform.email.value;

   if ((emailtest.indexOf('@') < 0) || ((emailtest.charAt(emailtest.length-4) != '.') && (emailtest.charAt(emailtest.length-3) != '.')))
     {alert("You have entered an invalid email address. You need to give us a valid email address before you can ask us a question!");
      return false;
     }

/* end of validateAgentForm(agentform) */
}



