/*
 * Function: submitOnChange
 *
 * This file should be suitable for script inclusion in a jsp or html file.
 */

/*
 * submitOnChange
 * --------------
 * When a select input is changed, it is immediately submitted, unless the
 * value is designated as one to be ignored.
 */

function submitOnChange(select, ignore)
{
  var value = select.options[select.selectedIndex].value;
  if (value == ignore) select.selectedIndex = -1;
  if (select.selectedIndex != -1) {
    var form = select.form;
    form.submit();
  }
}