<!-- // Activate cloak for old browsers

/*-------------------------------------------------------------------------+
 Function Name: isPhone

   Description: Check the control's value to make sure it is a valid
                phone number.

       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.
 szType              I   The type of number. I.e. 'phone', 'fax', etc.
 fHideAlert          I   True to hide alert; false, null, or leave out to
                          show alert.
+-------------------------------------------------------------------------*/
function isPhone(oControl, szControlName, szType, fHideAlert)
{
	// Remove spaces at the beginning and end
	oControl.value = trim(oControl.value);
	var szCheck = oControl.value;

	if (szCheck.length < 1)
		{
		// No entry
		if (! fHideAlert)
			{
			alert("Please enter a " + szType + " number in the\n'" + szControlName + "' field.");
			oControl.focus();
			}
		return(false);
		}

	var nCharPos, chPhone;

	for (nCharPos = 0; nCharPos < szCheck.length; nCharPos++)
		{
		chPhone = szCheck.charAt(nCharPos);

		if ((chPhone == '-') || (chPhone == '(') || (chPhone == ')') || (chPhone == ' '))
			continue;

		if ((chPhone < '0') || (chPhone > '9'))
			{
			// Invalid entry
			if (! fHideAlert)
				{
				alert("Please enter a valid " + szType + " number in the '" + szControlName +
				      "' field.\nOnly numbers, dashes, and () brackets are valid.");
				oControl.focus();
				}
			return(false);
			}
		}
	return(true);
}

// Deactivate cloak -->
