// JavaScript Document
function validate_email() {
    if(-1 == document.form1.emailaddr.value.indexOf("@")) { 
       document.form1.emailaddr.focus(); 
       alert("Your email must have a '@'."); 
       return false; 
       }
    if(-1 != document.form1.emailaddr.value.indexOf(",")) { 
       document.form1.emailaddr.focus(); 
       alert("Your email must not have a ',' in it"); 
       return false; 
       }
    if(-1 != document.form1.emailaddr.value.indexOf("#")) { 
       document.form1.emailaddr.focus(); 
       alert("Your email must not have an '#' in it." ); 
       return false; 
       }
    if(-1 != document.form1.emailaddr.value.indexOf("!")) { 
       document.form1.emailaddr.focus(); 
       alert("Your email must not have a '!' in it." ); 
       return false; 
       }
    if(-1 != document.form1.emailaddr.value.indexOf(" ")) { 
       document.form1.emailaddr.focus(); 
       alert("Your email must not have a space in it." ); 
       return false; 
       }
    if(document.form1.emailaddr.value.length == (document.form1.emailaddr.value.indexOf("@")+1) ) {
       document.form1.emailaddr.focus();
       alert("Your email must have a domain name after the '@'.");
       return false;
       }

    if(document.form1.emailaddr.value.length == 0) { 
      document.form1.emailaddr.focus(); 
      alert("Please enter your email."); 
      return false; 
      }

    return true;
  }
