// Note: This page will work only if either /include/validation/client/alertAndRefocus.js
// or /include/banner.asp has been included.

// This routine is *not* intended to be used to validate e-mail addresses!  It is
// intended to be used to examine fields where e-mail addresses should *not* appear,
// to see if an e-mail address has been inadvertently entered there.  (In particular,
// the "Address 2" line is often used incorrectly for e-mail addresses.)
function looksLikeEmailAddress(str)
{
	var at = "@";

	if (str != "")
	{
		if (str.indexOf(at) > -1)
		{
			return true;
		}
	}

	return false;
}

// For convenience sake, "&quot;" and "''" in errmsg will be changed to double quotes.
function checkForEmailAddress(this_field, errmsg)
{
	if (looksLikeEmailAddress(this_field.value))
	{
		alertAndRefocus(this_field, errmsg.replace(/&quot;/ig, '"').replace(/''/ig, '"'));
		return false;
	}
	
	return true;
}
