rem: gDialog.tree.selectItem(gDialog.treeItem); 
add: selectTreeItem(gDialog.treeItem); 
context: function Startup(){  if (!InitEditorShell())    return;  // Get a single selected select element  var tagName = "select";  selectElement = editorShell.GetSelectedElement(tagName);  if (selectElement)    // We found an element and don't need to insert one    insertNew = false;  else  {    insertNew = true;    // We don't have an element selected,    //  so create one with default attributes    selectElement = editorShell.CreateElementWithDefaults(tagName);    if(!selectElement)    {      dump("Failed to get selected element or create a new one!\n");      window.close();      return;    }  }  // SELECT element wrapper object  gDialog = {    accept:           document.documentElement.getButton("accept"),    selectDeck:       document.getElementById("SelectDeck"),    selectName:       document.getElementById("SelectName"),    selectSize:       document.getElementById("SelectSize"),    selectMultiple:   document.getElementById("SelectMultiple"),    selectDisabled:   document.getElementById("SelectDisabled"),    selectTabIndex:   document.getElementById("SelectTabIndex"),    optgroupLabel:    document.getElementById("OptGroupLabel"),    optgroupDisabled: document.getElementById("OptGroupDisabled"),    optionText:       document.getElementById("OptionText"),    optionHasValue:   document.getElementById("OptionHasValue"),    optionValue:      document.getElementById("OptionValue"),    optionSelected:   document.getElementById("OptionSelected"),    optionDisabled:   document.getElementById("OptionDisabled"),    removeButton:     document.getElementById("RemoveButton"),    previousButton:   document.getElementById("PreviousButton"),    nextButton:       document.getElementById("NextButton"),    tree:             document.getElementById("SelectTree"),    treeCols:         document.getElementById("SelectCols"),    treeItem:         document.getElementById("SelectItem"),    treeCell:         document.getElementById("SelectCell"),    treeChildren:     document.getElementById("SelectChildren"),    element:          selectElement.cloneNode(false),    globalIndex:      0,    onSpace:          function onSpace() {},    onFocus:          function onFocus()    {      gDialog.selectName.value = this.element.getAttribute("name");      gDialog.selectSize.value = this.element.getAttribute("size");      gDialog.selectMultiple.checked = this.element.hasAttribute("multiple");      gDialog.selectDisabled.checked = this.element.hasAttribute("disabled");      gDialog.selectTabIndex.value = this.element.getAttribute("tabindex");      this.selectDeck.setAttribute("selectedIndex", "0");      onNameInput();    },    onBlur:           function onBlur()    {      this.element.setAttribute("name", gDialog.selectName.value);      if (gDialog.selectSize.value)        this.element.setAttribute("size", gDialog.selectSize.value);      else        this.element.removeAttribute("size");      if (gDialog.selectMultiple.checked)        this.element.setAttribute("multiple", "");      else        this.element.removeAttribute("multiple");      if (gDialog.selectDisabled.checked)        this.element.setAttribute("disabled", "");      else        this.element.removeAttribute("disabled");      if (gDialog.selectTabIndex.value)        this.element.setAttribute("tabindex", gDialog.selectTabIndex.value);      else        this.element.removeAttribute("tabindex");    },    appendChild:      function appendChild(child)    {      if (child.tagName == "OPTION")      {        this.element.appendChild(child)        return new optionObject(this, child);      }      if (child.tagName == "OPTGROUP")      {        this.element.appendChild(child)        return new optgroupObject(this, child);      }      return null;    },    removeChild:      function removeChild(child)    {      this.treeChildren.removeChild(child.treeItem);      globalArray[child.globalIndex] = null;    },    canDestroy:       function canDestroy(prompt)    {      return false;    },    canMoveUp:        function canMoveUp()    {      return false;    },    canMoveDown:      function canMoveDown()    {      return false;    }  }  globalArray = [gDialog];  // Workaround for tree scrollbar bug  for (var col = gDialog.treeCols.firstChild; col.nextSibling; col = col.nextSibling)  {    col.setAttribute("width", col.boxObject.width);    col.removeAttribute("flex");  }  // We modify the actual option and optgroup elements so clone them first  for (var child = selectElement.firstChild; child; child = child.nextSibling)    gDialog.appendChild(child.cloneNode(true));  UpdateSelectMultiple();  gDialog.tree.selectItem(gDialog.treeItem);  onNameInput();  SetTextboxFocus(gDialog.selectName);  SetWindowLocation();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/07d96867f11683becf5e1a6ca5e64e6a9324c957/EdSelectProps.js/buggy/editor/ui/dialogs/content/EdSelectProps.js