<!-- // Activate cloak for old browsers

function processEmail(szCheck, oControl, szControlName, fHideAlert)
{
	if (szCheck.length < 1)
		{
		// No entry
		if (! fHideAlert)
			{
			alert("Please enter an email address in the '" + szControlName + "' field.");
			oControl.focus();
			}
		return(false);
		}

	var nAtPos;
	nAtPos = szCheck.indexOf("@");

	if (nAtPos == -1)
		{
		// No @ symbol in the email
		if (! fHideAlert)
			{
			alert("Please enter the '@' and a domain name in the\nemail address for the '" + szControlName + "' field.");
			oControl.focus();
			}
		return(false);
		}

	if (szCheck.substring(0, nAtPos) == '')
		{
		// The username is blank
		if (! fHideAlert)
			{
			alert("Please enter a user name in the\nemail address for the '" + szControlName + "' field.");
			oControl.focus();
			}
		return(false);
		}
	else if (szCheck.substring(nAtPos + 1, szCheck.length) == '')
		{
		// The domain is blank
		if (! fHideAlert)
			{
			alert("Please enter a domain name in the\nemail address for the '" + szControlName + "' field.");
			oControl.focus();
			}
		return(false);
		}

	// Check for invalid characters
	var chEmail;
	var nCharPos;

	// Check the user name part of the email (left of the @)
	for (nCharPos = 0; nCharPos < nAtPos; nCharPos++)
		{
		chEmail = szCheck.charAt(nCharPos).toLowerCase();
		// User name allows numbers, the @ symbol, periods, dashes, and underscores
		if (!(((chEmail >= "a") && (chEmail <= "z")) ||
		      ((chEmail >= "0") && (chEmail <= "9")) ||
		      (chEmail == '.') || (chEmail == '-') || (chEmail == '_')))
			{
			// The user name is incorrect
			if (! fHideAlert)
				{
				alert("Please enter a valid user name in the email address for the '" + szControlName +
				      "' field.\nOnly letters, numbers, periods, dashes, and underscores are valid.");
				oControl.focus();
				}
			return(false);
			}
		}


	// A "." must be in the domain name and it can't be next to @ and can't be the last character
	if ((szCheck.indexOf(".", nAtPos) == (nAtPos + 1)) || (szCheck.charAt(szCheck.length - 1) == '.') ||
	   (szCheck.indexOf(".", nAtPos) == -1))
	   {
		// The domain is incorrect
		if (! fHideAlert){
			alert("Please enter a valid domain name in the\nemail address for the '" + szControlName + "' field.");
			oControl.focus();
		}
		return(false);
	   }

	// Check the domain name part of the email (right of the @)
	for (nCharPos = nAtPos + 1; nCharPos < szCheck.length; nCharPos++){
		chEmail = szCheck.charAt(nCharPos).toLowerCase();
		// Domain allows numbers, the @ symbol, periods, dashes, and underscores
		if (!(((chEmail >= "a") && (chEmail <= "z")) || ((chEmail >= "0") && (chEmail <= "9")) ||
		   (chEmail == '.') || (chEmail == '-') || (chEmail == '_'))){
			// The domain is incorrect
			if (! fHideAlert){
				alert("Please enter a valid domain name in the email address for the '" + szControlName +
			        "' field.\nOnly letters, numbers, periods, dashes, and underscores are valid.");
				oControl.focus();
			}
			return(false);
		}
	}
	return(true);
}

/*-------------------------------------------------------------------------+
 Function Name: isEmail

   Description: Check the control's value to make sure it is a valid
                email address.

       Returns: true if the value is okay, false if not.
+--------------------------------------------------------------------------+
|                             A r g u m e n t s                            |
+--------------------------------------------------------------------------+
 Name               I/O  Description
 ================== ===  ==================================================
 oControl            I   The control to examine.
 szControlName       I   The display name of the control.
 fHideAlert          I   True to hide alert; false, null, or leave out to
                          show alert.
+-------------------------------------------------------------------------*/
function isEmail(oControl, szControlName, fHideAlert)
{
	// Remove any leading or trailing spaces
	oControl.value = trim(oControl.value);
	var szEmail = oControl.value;

	return(processEmail(szEmail, oControl, szControlName, fHideAlert));
}

/*-------------------------------------------------------------------------+
 Function Name: isEmailMulti

   Description: Check the control's value to make sure it is a valid
                email address, allows for multiple emails seperated by a
                semicolon.

       Returns: true if the value is okay, false if not.
+--------------------------------------------------------------------------+
|                             A r g u m e n t s                            |
+--------------------------------------------------------------------------+
 Name               I/O  Description
 ================== ===  ==================================================
 oControl            I   The control to examine.
 szControlName       I   The display name of the control.
 fHideAlert          I   True to hide alert; false, null, or leave out to
                          show alert.
+-------------------------------------------------------------------------*/
function isEmailMulti(oControl, szControlName, fHideAlert)
{
	// Remove any leading or trailing spaces
	oControl.value = trim(oControl.value);
	var rgszEmails = oControl.value.split(';');

	for (var iEmail = 0; iEmail < rgszEmails.length; iEmail++)
		{
		if (! processEmail(rgszEmails[iEmail], oControl, szControlName, fHideAlert))
			return(false);
		}
	return(true);
}

// Deactivate cloak -->
