rem: document.documentElement.getButton("extra2").focus(); 
add: dButton = document.documentElement.getButton("extra2"); 
context: function commonDialogOnLoad(){  // set the window title  window.title = gCommonDialogParam.GetString(12);  // set the number of command buttons  var nButtons = gCommonDialogParam.GetInt(2);  var dialog = document.documentElement;  switch (nButtons) {    case 1:      dialog.getButton("cancel").hidden = true;      break;    case 4:      dialog.getButton("extra2").hidden = false;    case 3:      dialog.getButton("extra1").hidden = false;  }  // display the main text  var messageText = gCommonDialogParam.GetString(0);  var messageParent = document.getElementById("info.box");  var messageParagraphs = messageText.split("\n");  for (var i = 0; i < messageParagraphs.length; i++) {    var descriptionNode = document.createElement("description");    var text = document.createTextNode(messageParagraphs[i]);    descriptionNode.appendChild(text);    messageParent.appendChild(descriptionNode);  }  setElementText("info.header", gCommonDialogParam.GetString(3), true);  // set the icon  var iconElement = document.getElementById("info.icon");  var iconClass = gCommonDialogParam.GetString(2);  if (!iconClass)    iconClass = "message-icon";  iconElement.setAttribute("class", iconElement.getAttribute("class") + " " + iconClass);  switch (nButtons) {    case 4:      setLabelForNode(document.documentElement.getButton("extra2"), gCommonDialogParam.GetString(11));      // fall through    case 3:      setLabelForNode(document.documentElement.getButton("extra1"), gCommonDialogParam.GetString(10));      // fall through    default:    case 2:      var string = gCommonDialogParam.GetString(9);      if (string)        setLabelForNode(document.documentElement.getButton("cancel"), string);      // fall through    case 1:      string = gCommonDialogParam.GetString(8);      if (string)        setLabelForNode(document.documentElement.getButton("accept"), string);      break;  }  // set default result to cancelled  gCommonDialogParam.SetInt(0, 1);   // initialize the checkbox  setCheckbox(gCommonDialogParam.GetString(1), gCommonDialogParam.GetInt(1));  if (gCommonDialogParam.GetInt(3) == 0) // If no text fields  {    var defaultButton = gCommonDialogParam.GetInt(5);    switch (defaultButton) {      case 3:        document.documentElement.getButton("extra2").focus();        break;      case 2:        document.documentElement.getButton("extra1").focus();        break;      case 1:        document.documentElement.getButton("cancel").focus();        break;      default:      case 0:        document.documentElement.getButton("accept").focus();        break;    }  }  getAttention();}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/e66742e59c0adb4e972b18c926d20479091a143c/commonDialog.js/buggy/xpfe/global/resources/content/commonDialog.js