rem: var disableElements = document.getElementsByAttribute("disableforreadonly", "true"); for (var i = disableElements.length; i-- > 0; ) disableElements[i].disabled = true; 
add:  for (var i = kVcardFields.length; i-- > 0; ) document.getElementById(kVcardFields[i][0]).readonly = true;   document.getElementById(kPhoneticFields[0]).readonly = true; document.getElementById(kPhoneticFields[3]).readonly = true;   document.getElementById("PreferMailFormatPopup").disabled = true; 
context: function OnLoadEditCard(){  InitEditCard();  gEditCard.titleProperty = "editCardTitle";  if (window.arguments && window.arguments[0])  {    if ( window.arguments[0].card )      gEditCard.card = window.arguments[0].card;    if ( window.arguments[0].okCallback )      gOkCallback = window.arguments[0].okCallback;    if ( window.arguments[0].abURI )      gEditCard.abURI = window.arguments[0].abURI;  }  // set global state variables  // if first or last name entered, disable generateDisplayName  if (gEditCard.generateDisplayName &&      (gEditCard.card.firstName.length +       gEditCard.card.lastName.length +       gEditCard.card.displayName.length > 0))  {    gEditCard.generateDisplayName = false;  }  GetCardValues(gEditCard.card, document);  SetCardDialogTitle(gEditCard.card.displayName);  // check if selectedAB is a writeable  // if not disable all the fields  if ("arguments" in window && window.arguments[0])  {    if ("abURI" in window.arguments[0]) {      var abURI = window.arguments[0].abURI;      var directory = GetDirectoryFromURI(abURI);      if (!(directory.operations & directory.opWrite))       {        var disableElements = document.getElementsByAttribute("disableforreadonly", "true");        for (var i = disableElements.length; i-- > 0; )          disableElements[i].disabled = true;        document.documentElement.buttons = "accept";        document.documentElement.removeAttribute("ondialogaccept");      }    }  }}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/708889d596505f9f018652509407e4269655d990/abCardOverlay.js/buggy/mailnews/addrbook/resources/content/abCardOverlay.js