<!-- // Activate cloak for old browsers

/*-------------------------------------------------------------------------+
 Function Name: isRange

   Description: Check the length of a control's value to make sure it
                 fits within desired length range.

       Returns: true if the text string range 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.
 nMinLength          I   The minimum length of the string. Use 0 if no
                          minimum.
 nMaxLength          I   The maximum length of the string. Use null if no
                          maximum.
 fHideAlert          I   True to hide alert; false, null, or leave out to
                          show alert.
+-------------------------------------------------------------------------*/
function isRange(oControl, szControlName, nMinLength, nMaxLength, fHideAlert)
  {
  // Remove any leading or trailing spaces
  oControl.value = trim(oControl.value);
  var szValue = oControl.value;

  if (szValue.length < nMinLength)
    {
    // Too short
    if (! fHideAlert)
      {
      if ((szValue == '') || (nMinLength == 1))
        alert("Please fill out the '" + szControlName + "' field.");
      else if (nMinLength == nMaxLength)
        alert("Please enter exactly " + nMinLength + " characters in the '" +
              szControlName + "' field.");
      else
        alert("Please enter at least " + nMinLength + " characters in the '" +
              szControlName + "' field.");

      oControl.focus();
      }
    return(false);
    }
  else if ((nMaxLength != null) && (szValue.length > nMaxLength))
    {
    // Too long
    if (! fHideAlert)
      {
      if (nMaxLength == 1)
        alert("Please enter only one character in the '" + szControlName + "' field.");
      else if (nMinLength == nMaxLength)
        alert("Please enter exactly " + nMinLength + " characters in the '" +
              szControlName + "' field.");
      else
        alert("Please enter at most " + nMaxLength + " characters in the '" +
              szControlName + "' field.");

      oControl.focus();
      }
    return(false);
    }
  return(true);
  }

// Deactivate cloak -->

