Ajax.InPlaceSelectEditor = Class.create();
Object.extend(Object.extend(Ajax.InPlaceSelectEditor.prototype,
                            Ajax.InPlaceEditor.prototype), {
    createEditField: function() {
        var text;
        if(this.options.loadTextURL) {
            text = this.options.loadingText;
        } else {
            text = this.getText();
        }
 
        var selectField = document.createElement("select");
        selectField.name = "value";
        var options = this.options.selectOptionsHTML;   
        var pvalue = this.options.passedValue;     

        for (var x=0; x<options.length; x++)
        {
            var option = document.createElement("option");
            option.appendChild(document.createTextNode(options[x]));
            option.setAttribute("value",pvalue[x]);
            selectField.appendChild(option);
        }
        $A(selectField.options).each(function(opt, index){
            if(text == opt.text) {
                selectField.selectedIndex = index;
            }
        }
    );
        selectField.style.backgroundColor = this.options.highlightcolor;
        this.editField = selectField;
        this.editField.style.backgroundColor="";
        this.editField.className= "editor_field";
        if(this.options.loadTextURL) {
          this.loadExternalText();
        }
        
        selectField.selectedIndex = this.options.selectedIndex;
        this.form.appendChild(this.editField);
    }
});