

function checkEmailAddress(theAddress) {
var goodEmail = theAddress.value.match(/\b(^(\S+@).+((\.com)|(\.ca)|(\.fr)|(\.ws)|(\.tv)|(\.de)|(\.cc)|(\.name)|(\.jp)|(\.ro)|(\.pro)|(\.be)|(\.fm)|(\.ms)|(\.tc)|(\.za)|(\.nz)|(\.ph)|(\.dk)|(\.st)|(\.ac)|(\.gs)|(\.vu)|(\.vg)|(\.sh)|(\.kz)|(\.as)|(\.lt)|(\.il)|(\.to)|(\.uk)|(\.biz)|(\.info)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org))$)\b/gi);
if (goodEmail){
   return true;
} else {
   return false;
   }
}

function validate(){
	// check that email is provided
	if (document.form1.email.value.length == 0){
		alert("Please provide your e-mail address.");
       document.form1.email.focus();
       document.form1.email.select();
		return false;
		}
   // check that it is a valid e-mail address
   var validFromEmail = checkEmailAddress(document.form1.email);
   if (validFromEmail == false){
       alert("You did not enter in a valid e-mail address. Please provide your e-mail address.");
       document.form1.email.focus();
       document.form1.email.select();
       return false;
       }
} 

