// Proper e-mail check script
function emailCheck( emailFormField, showerror ) {

	var txt=emailFormField.value;  
	var error = "";
	
	var emailRe = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/
	var phoneRe = /^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/
                  
	if (!(emailRe.test(txt))) { 
		   error = "Please enter a valid email address.\n";
	}
	
	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
	if (txt.match(illegalChars)) {
	   error += "The email address contains illegal characters.\n";
	}
	
	if( error.length > 0 ) {
		if(showerror) {
		    emailFormField.focus();
			alert(error);	
		}
		return false;
	}
	return true;  
}
