function checkform(lst) {
   if(document.forms[lst].FirstName.value=="") {
      document.forms[lst].FirstName.style.backgroundColor='yellow';
      alert("Name is a required field.");
      document.forms[lst].FirstName.focus();
      return;
   } else {
      document.forms[lst].FirstName.style.backgroundColor='white';
   }
 
   if(document.forms[lst].Email.value=="") {
      document.forms[lst].Email.style.backgroundColor='yellow';
      alert("Email Address is a required field.");
      document.forms[lst].Email.focus();
      return;
   } else {
     if (echeck(document.forms[lst].Email.value)==false) {
        document.forms[lst].Email.style.backgroundColor='yellow';
        alert("Email Address does not appear to be valid.");
        document.forms[lst].Email.focus();
        return;
     } else {
       document.forms[lst].Email.style.backgroundColor='white';
     }
   }

   document.forms[lst].submit();
}


function echeck(str) {
   var at="@";
   var dot=".";
   var lat=str.indexOf(at);
   var lstr=str.length;
   var ldot=str.indexOf(dot);
   if (str.indexOf(at)==-1){
      return false;
   }
   if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
      return false;
   }
   if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
      return false;
   }
   if (str.indexOf(at,(lat+1))!=-1){
      return false;
   }
   if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
      return false;
   }
   if (str.indexOf(dot,(lat+2))==-1){
      return false;
   }	
   if (str.indexOf(" ")!=-1){
      return false;
   }

   return true;
}