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