// General javascript eMail functions 

function checkEmail(oFld) {
// Validate the chosen email address - pass in the input field object. 
// eg. return checkEmail(this)

	var valid=false
	var str=trimString(oFld.value)
	
	if (str!="") {
		var filter=/^([\w-\']+(?:\.[\w-\']+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		if (filter.test(str))
			valid=true
		else {
			alert("Sorry, but this is not a valid email address. Please try again.");
			valid=false
			}
		}
	else
		valid=true
	
	if (!valid) {
        //oFld.focus()
        // Need to do this for Firefox
        setTimeout(function(){oFld.focus()}, 1);
	}
	return (valid)
}

