//
function selectAll (pendingform, state) {
  // Sets all of the radio buttons or select boxes to the same item.
  var counter = 0;
  var blah;
  blah = new (String) (state);
  while ( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0) != null) {
    if (("checkbox".indexOf ( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).type)) != -1) {
         _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).checked=state;
    } else {
      if (("radio".indexOf ( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).type)) != -1) {
        if ((blah.indexOf ( _proxy_jslib_handle( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0), 'value', '', 0, 0))) != -1) {
           _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).click();
        }
      } else {
        if ( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).options != null) {
          if( _proxy_jslib_handle( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).options, (state), 0, 0) != null) {
             _proxy_jslib_handle( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).options, (state), 0, 0).selected = true;
          }
        }
      }
    }
    counter++;
  }
  return false;
}

function newSelectAll (pendingform, state, testname) {
  // Sets all of the radio buttons or select boxes to the same item.
  var counter = 0;
  var arLen, nameLen, i;
  var elName;
  var found = 0;

  if (state == "reset") {
    pendingform.reset();
    return false;
  }

  while ( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0) != null) {
    if ( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).name == "bulkset") {
      counter++;
      continue;
    }

    if (testname) {
      found = 0;
      arLen = testname.length;
      for(i=0;(i<arLen) && !found;i++) {
        nameLen =  _proxy_jslib_handle(testname, (i), 0, 0).length;
        elName =  _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).name.substring(0,nameLen)
 if (elName ==  _proxy_jslib_handle(testname, (i), 0, 0)) {
          found = 1;
        }
      }

      if (!found) {
        counter++;
        continue;
      }
    }

    if (("radio".indexOf( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).type)) != -1) {
      if ( _proxy_jslib_handle( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0), 'value', '', 0, 0) == state) {
         _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).click();
      }
    } else {
      if ( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).options != null) {
        i = 0;
        while ( _proxy_jslib_handle( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).options, (i), 0, 0) != null) {
          if ( _proxy_jslib_handle( _proxy_jslib_handle( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).options, (i), 0, 0), 'value', '', 0, 0) == state) {
             _proxy_jslib_handle( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).options, (i), 0, 0).selected = true;
          }
          i++;
        }
      }
    }
    counter++;
  }
  return false;
}

function CheckAll (pendingform, state, testname) {
  // Sets all of the checkbox.
  var counter = 0;
  var arLen, nameLen, i;
  var elName;
  var found = 0;

  if (state == "reset") {
    pendingform.reset();
    return false;
  }

  while ( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0) != null) {
    if ( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).name == "bulkset" ||
         _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).name == "checkbox_bulkset") {
      counter++;
      continue;
    }

    if (testname) {
      found = 0;
      arLen = testname.length;
      for(i=0;(i<arLen) && !found;i++) {
        nameLen =  _proxy_jslib_handle(testname, (i), 0, 0).length;
        elName =  _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).name.substring(0,nameLen)
 if (elName ==  _proxy_jslib_handle(testname, (i), 0, 0)) {
          found = 1;
        }
      }

      if (!found) {
        counter++;
        continue;
      }
    }

    if (("checkbox".indexOf( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).type)) != -1) {
      if ( _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).checked != state) {
         _proxy_jslib_handle(pendingform.elements, (counter), 0, 0).checked = state;
      }
    }
    counter++;
  }
  return false;
}
 ;
_proxy_jslib_flush_write_buffers() ;