function checkForm() {
 
  firstname = document.emaillist.firstname.value;
  lastname = document.emaillist.lastname.value;
  email = document.emaillist.email.value;
  filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  
 returnval = true;
 hideAllErrors();
  if (firstname == "") {
 returnval = false;
 document.getElementById("firstnameError").style.display = "inline";
  }
 if (lastname == "") {
 returnval = false;
 document.getElementById("lastnameError").style.display = "inline";
  } 
 if (email == "") {
 returnval = false;
 document.getElementById("emailError").style.display = "inline";
  }
if (email != "" && !(filter.test(email))) { 
 returnval = false;
 document.getElementById("email2Error").style.display = "inline";
 }
 return returnval;
}
 
  function hideAllErrors() {
document.getElementById("firstnameError").style.display = "none"
document.getElementById("lastnameError").style.display = "none"
document.getElementById("emailError").style.display = "none"
document.getElementById("email2Error").style.display = "none"
}


