<!--

    if(typeof(select_insert_option) == "undefined") {
        select_insert_option = function(index, text, value, select_index) {
            for(var i = this.length; i > index; i--)
                this.options[i] = new Option(this.options[i - 1].text, this.options[i - 1].value);

            this.options[index] = new Option(text, value);
            if(select_index) this.selectedIndex = index;
        }
    }

    if(typeof(select_update_option) == "undefined") {
        select_update_option = function(index, text, value, select_index) {
            text = typeof(text) != "undefined" ? text : this.options[index].text;
            value = typeof(value) != "undefined" ? value : this.options[index].value;

            this.options[index] = new Option(text, value);
            if(select_index) this.selectedIndex = index;
        }
    }

    if(typeof(select_remove_option) == "undefined") {
        select_remove_option = function (index, select_index) {
            for(var i = index; i < this.length - 1; i++)
                this.options[i] = new Option(this.options[i + 1].text, this.options[i + 1].value);

            this.options[this.length - 1] = null;
            if(select_index) this.selectedIndex = index >= this.length ? this.length - 1 : index;
        }
    }

    if(typeof(select_shift_option) == "undefined") {
        select_shift_option = function (index, shift, select_index) {
            if(index + shift >= 0 && index + shift < this.length) {
                var temp = new Option(this.options[index].text, this.options[index].value);
                this.remove(index);
                this.insert(index + shift, temp.text, temp.value);
                if(select_index) this.selectedIndex = index + shift >= 0 && index + shift < this.length ? index + shift : index;
            }
        }
    }

    if(typeof(select_set_options) == "undefined") {
        select_set_options = function (option_array, select_index) {
            index = 0;
            for(var key in option_array) {
                this.options[index] = new Option(option_array[key], key);
                index++;
            }

            while(this.length > index)
                this.options[index] = null;

            if(select_index) this.selectedIndex = index;
        }
    }

    if(typeof(select_clear_options) == "undefined") {
        select_clear_options = function () {
            while(this.length)
                this.options[0] = null;
        }
    }

    if(typeof(super_select) == "undefined") {
        super_select = function(selector, enable_keystrokes) {
            selector.insert = select_insert_option;
            selector.update = select_update_option;
            selector.remove = select_remove_option;
            selector.shift  = select_shift_option;
            selector.set    = select_set_options;
            selector.clear  = select_clear_options;

            if(enable_keystrokes && document.all) {
                document.onkeypress = new Function("process_keyPress(event.srcElement, event.keyCode)");
            }
        }
    }

    if(typeof(process_keyPress) == "undefined") {
        function process_keyPress(source, keycode) {
            if(source.type == "select-one") {
                switch(keycode) {
                    case 43: select_insert(source); break;
                    case 13: select_update(source); break;
                    case 45: select_remove(source); break;
                    case 44: select_upshift(source); break;
                    case 46: select_downshift(source);
                }
            }
        }
    }

//-->
