rem:  /* initialization OK and Cancel buttons */  doSetOKCancel(Save, Cancel); 
context: function Startup() {  /* fetch the input */  var list = walletpreview.GetPrefillValue();  var BREAK = list[0];  prefillList = list.split(BREAK);  var menuPopup;  var count;  /* create the fill-in entries */  for (var i=1; i<prefillList.length-1; i+=3) {    if(prefillList[i] != 0) {      count = prefillList[i];      menuPopup = document.createElement("menupopup");    }    count--;    var menuItem = document.createElement("menuitem");    if (count == (prefillList[i]-1)) {      menuItem.setAttribute("selected", "true");    }    menuItem.setAttribute("label", prefillList[i+2]);    // Avoid making duplicate entries in the same menulist    var child = menuPopup.firstChild;    var alreadyThere = false;    while (child) {      if (child.getAttribute("label") == prefillList[i+2]) {        alreadyThere = true;        break;      }      child = child.nextSibling;    }    if (!alreadyThere) {      menuPopup.appendChild(menuItem);    }    if(count == 0) {      //create the menulist of form data options.      var menuList = document.createElement("menulist");      menuList.setAttribute("data", prefillList[i+1]);      menuList.setAttribute("id", "xx"+(++fieldCount));      menuList.setAttribute("allowevents", "true");      menuList.appendChild(menuPopup);      //create the checkbox for the menulist.      var localCheckBox = document.createElement("checkbox");      localCheckBox.setAttribute("id", "x"+fieldCount);      // Note: menulist name is deliberately chosen to be x + checkbox name in      //       order to make it easy to get to menulist from associated checkbox      localCheckBox.setAttribute("oncommand", "UpdateMenuListEnable(this)");      localCheckBox.setAttribute("checked", "true");      localCheckBox.setAttribute("crop", "right");            //fix label so it only shows title of field, not any of the url.      var colonPos = prefillList[i+1].indexOf(':');      var checkBoxLabel;      if (colonPos != -1)        checkBoxLabel = prefillList[i+1].slice(colonPos + 1)      else        checkBoxLabel = prefillList[i+1];      localCheckBox.setAttribute("label", checkBoxLabel );      //append all the items into the row.      var row = document.createElement("row");      row.appendChild(localCheckBox);      row.appendChild(menuList);      var rows = document.getElementById("rows");      rows.appendChild(row);      // xul bug: if this is done earlier, it will result in a crash (???)      menuList.setAttribute("editable", "true");    }  }  /* initialization OK and Cancel buttons */  doSetOKCancel(Save, Cancel);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/1cb87bfc43eb3bef5759b85ed2d85f0168440839/WalletPreview.js/buggy/extensions/wallet/walletpreview/WalletPreview.js