<!-- // Activate cloak for old browsers

/*-------------------------------------------------------------------------+
 Function Name: isChecked

   Description: Check a single or an array of checkboxes or radio buttons
                to make see if one or a number of the controls has been
                checked.

       Returns: true if at checked item count is correct, false if not.
+--------------------------------------------------------------------------+
|                             A r g u m e n t s                            |
+--------------------------------------------------------------------------+
 Name               I/O  Description
 ================== ===  ==================================================
 oControl            I   The control array to examine.
 szControlName       I   The display name of the control.
 nMinChecked         I   The number of controls that need to be checked.
 fHideAlert          I   True to hide alert; false, null, or leave out to
                          show alert.
+-------------------------------------------------------------------------*/
function isChecked(oControl, szControlName, nMinChecked, fHideAlert)
  {
  var nChecked = 0;

  // Check to see if there is only one check box or an array of checkboxes
  if (oControl.length == null)
    {
    if (oControl.checked)
      nChecked += 1;
    }
  else
    {
    var iCheckbox;

    // Loop through each checkbox
    for (iCheckbox = 0; iCheckbox < oControl.length; iCheckbox++)
      {
      // Find out if this option is selected
      if (oControl[iCheckbox].checked)
        {
        // We found a checked control, increment the count
        nChecked += 1;

        if (nChecked == nMinChecked)
          break; // No need to keep processing loop
        }
      }
    }

  if (nChecked < nMinChecked)
    {
    if (! fHideAlert)
      {
      if (oControl.length == null)
        {
        if (oControl.type == "checkbox")
          alert("Please check the '" + szControlName + "' checkbox.");
        else
          alert("Please select the '" + szControlName + "' radio button.");

        oControl.focus();
        }
      else
        {
        if (oControl[0].type == "checkbox")
          {
          if (nMinChecked == 1)
            alert("Please check at least one '" + szControlName + "' checkbox.");
          else
            alert("Please check at least " + nMinChecked + " '" + szControlName + "' checkboxes.");
          }
        else
          alert("Please select one '" + szControlName + "' radio button.");

        oControl[0].focus();
        }
      }
    return(false);
    }
  else
    return(true);
  }

// Deactivate cloak -->

