function isMatch(mode, value){
	var thePattern = "";
	switch (mode.toLowerCase()){
		case "email":
			thePattern = /([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})/;
			break;
		case "pobox":
			thePattern = /P(ost)?[\s|\.]*(O(ffice)?[\s|\.]*)?(B(ox)?[\s|\.|#]*)?\d+|P(ostal)?[\s|\.]*(S(ervice)?[\s|\.]*)?(C(enter)?[\s|\.|#]*)?\d+|P(ostal)?[\s|\.]*(B(ox)?[\s|\.|#]*)?\d+|Box[\s|\.|#]*\d+/i;
			break;
		default:
			return false;
			break;
	}
    var theValue = value.replace(/^\s*|\s*$/g, "");

   	if (thePattern.test(theValue)){
		return true;
	}
	return false;
}
function checkNewsletterEmail(myForm) {
	if (!isMatch("email", myForm.email.value)){
		alert( "Email address is invalid.");
		myForm.email.select();
		return false;
	}
}
function blurTopNav(theField, theValue){
	if (theField.value == ''){
		theField.value = theValue;
	}
}
function focusTopNav(theField, theValue){
	if (theField.value == theValue){
		theField.value = '';
	}
}

