// JavaScript Document

function checkEmail (value) {

var strng=value;
			var error="";
			if (strng == "") {
						error = "You didn't enter an email address.\n";
			}
		
						var emailFilter=/^.+@.+\..{2,3}$/;        
						if (!(emailFilter.test(strng))) { 
									error = "Please enter a valid email address.\n";
						} 
						else {
				var x=0;
			for(i=0; i<strng.length; i++) {
					if (strng.charAt(i)=="@") {
						x++;
						}			
				}
				if (x>1) {
										error = "Please enter a valid email address.\n";
								} 
				//test email for illegal characters
							var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/;
							if (strng.match(illegalChars)) {
										error = "The email address contains illegal characters.\n";
							}
					}
	
				return error;
 
}
