function validateinputs()
{
if (document.theform.email.value == "")
  {
    alert("Please correct the following error: Please enter your Email Address.");
    document.theform.email.focus();
    return (false);
  }
  
  if (document.theform.email.value != "")
  {
     if (!(isEmailAddr(document.theform.email.value)))
     {
       alert("Please correct the following error: You have entered an invalid email address. Please enter a valid email address");
       document.theform.email.focus();
       return (false);
     }
   }
  document.theform.hidpost.value="post";     
  document.theform.submit();  
 }
 
 function isEmailAddr(email)
  {
    var result = false;
    var theStr = new String(email);
    var index = theStr.indexOf("@");
    if (index > 0)
    {
      var pindex = theStr.indexOf(".",index);
      if ((pindex > index+1) && (theStr.length > pindex+1))
	    result = true;
    }
    return result;
  }
