// the javascript quickform email address validator.
//based on a reg expression taken from http://www.4guysfromrolla.com/webtech/052899-1.shtml
// essentially the expression garauntees the email addresses that pass muster will conform the following rules:
/*
The first part:
^[\\w-_\.]
^ means "check the first character". In this case it's checking to make sure its a word character (a-z0-9) using \\w and it can also be a underscore, hyphen, or period (although this isn't normal, they are legal email characters)

Next:
*[\\w-_\.]
The * means "match the preceding zero or more times". and of course the next part [\\w-_\.] makes sure they are word characters or underscores, etc.

Next:
\@[\\w]\.+
\@ checks for the @ symbol. \.+ means find at least one period after symbol. This means it must be in the @w. format and not @. or @#.

Last:
[\\w]+[\\w]$
[\\w] makes sure there is a word character after the period. [\\w]$ checks the last character to make sure it's a word character (domain or IP address) and not a odd character. $ means "check the last character". 

*/



function email_check(src) 
{
     var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
     var regex = new RegExp(emailReg);
	 if (src == null || src == "" || src=="your email")
	 {
		alert("Please enter a valid email address.") ;    
		return false ; 
	 }
     else if (regex.test(src))
	 {
		return true; 
	 }
	 else
	 {
		alert("Your email was not formatted correctly.\nPlease use the format: name@company.com with only numbers, letters, '-',' _', or '.'") ;    
		return false ;
	 }
  }
