<!--
  var OPTION_TEXT = 0;
  var OPTION_VALUE = 1;
  var FIRST_SUB_OPTION = 2;
  var COMBO_BOX_SETS = 0;

  function set_options() {
    var option_list = arguments[0];
    var selectedIndex = typeof(option_list[arguments[1]]) != "undefined" ? arguments[1] : 0;
    var select_box = arguments[2];

    while(select_box.options.length > option_list.length) {
      select_box.options[select_box.options.length - 1] = null;
    }

    for(var i = 0; i < option_list.length; i++) {
      select_box.options[i] = new Option(option_list[i][OPTION_TEXT], option_list[i][OPTION_VALUE]);
      select_box.options[selectedIndex].selected = (i == selectedIndex);
    }

    if(arguments.length > 3) {
      var eval_string = "set_options(";

      if(option_list.length == 0 || option_list[selectedIndex].length <= FIRST_SUB_OPTION)
        eval_string += "[], 0, ";
      else
        eval_string += "option_list[selectedIndex].slice(FIRST_SUB_OPTION), 0, ";

      var separator = "";

      for(var j = 3; j < arguments.length; j++) {
        eval_string += separator + "arguments[" + j + "]";
        separator = ", ";
      }

      eval(eval_string + ")");
    }
  }

  function initialize_combo_boxes() {
    eval("combo_box_options_" + COMBO_BOX_SETS + " = arguments[0]");

    for(var i = 1; i < arguments.length - 1; i++) {
      var option_list = "";
      var index_adjuster = 0;

      for(var j = i ; j > 0; j--) {
        index_adjuster = j == 1 ? 0 : FIRST_SUB_OPTION;
        option_list = "[" + "document." + arguments[j].form.name + "." + arguments[j].name + ".selectedIndex + " + index_adjuster + "]" + option_list;
      }

      if(option_list) option_list += ".slice(" + FIRST_SUB_OPTION + ")";
      option_list = "combo_box_options_" + COMBO_BOX_SETS + option_list;

      var sub_select_list = "";

      for(var j = i + 1; j < arguments.length; j++) {
        sub_select_list += ", document." + arguments[j].form.name + "." + arguments[j].name;
      }

      var onchange_body = 
        "set_options(" +
          option_list + ", " +
          "0" +
          sub_select_list +
        ")";

      if(arguments[i].onchange && document.all) {
        arguments[i].onchange = add_to_function_beg(
          arguments[i].onchange,
          onchange_body
        );
      }
      else {
        arguments[i].onchange = new Function(
          onchange_body
        );
      }
    }

    var eval_string = "set_options(combo_box_options_" + (COMBO_BOX_SETS++) + ", 0, ";
    var separator = "";

    for(var j = 1; j < arguments.length; j++) {
      eval_string += separator + "arguments[" + j + "]";
      separator = ", ";
    }

    eval(eval_string + ");");
  }
  function add_to_function_beg(func, addition) {
    if(func) {
      var args = new String(func).replace(/^function +.*\((.*)\)[ \n]*\{((.*\n?)*)\}$/, "$1");
      var body = new String(func).replace(/^function +.*\((.*)\)[ \n]*\{((.*\n?)*)\}$/, "$2");

      args = args.length ? ("\"" + args.split(", ").join("\", \"") + "\"") : "";
      body = addition + (body && addition ? "; " : "") + body;

      eval("func = new Function(" + args + (args && body ? ", " : "") + "body)");
      return func;
    }
  }
//-->
