rem: addressbook = Components.classes["@mozilla.org/addressbook;1"]. createInstance(Components.interfaces.nsIAddressBook); 
add: addressbook = Components.classes["@mozilla.org/addressbook;1"] .getService(Components.interfaces.nsIAddressBook); 
context: function onAccept(){  var len = gDeletedDirectories.length;  if (len) {    try {      var directoryServer = gPrefInt.getCharPref("ldap_2.autoComplete.directoryServer");    }    catch(ex)  {      directoryServer = null;    }    var am = Components.classes["@mozilla.org/messenger/account-manager;1"]                 .getService(Components.interfaces.nsIMsgAccountManager);    if (am) {      var addressbook;      try {        addressbook = Components.classes["@mozilla.org/addressbook;1"].                         createInstance(Components.interfaces.nsIAddressBook);      }      catch(ex){        dump("Failed to get addressbook " + ex + "\n");      }       var allIdentities = am.allIdentities;      var identitiesCount = allIdentities.Count();      var identityServer = new Array();      var currentIdentity = null;      var j;      for (j=0; j< identitiesCount; j++) {        currentIdentity = allIdentities.QueryElementAt(j, Components.interfaces.nsIMsgIdentity);        identityServer[j] = {server:currentIdentity.directoryServer, deleted:false};      }      var deletedGlobal = false;      for (var i=0; i< len; i++){        if (!deletedGlobal && directoryServer && (gDeletedDirectories[i] == directoryServer)) {          gPrefInt.setCharPref("ldap_2.autoComplete.directoryServer", "");          deletedGlobal = true;        }        for (j=0; j<identitiesCount; j++){          if (identityServer[j].server && !identityServer[j].deleted && (gDeletedDirectories[i] == identityServer[j].server)) {            identityServer[j].server = "";            identityServer[j].deleted = true;          }        }        try {          // The for LDAPDirectory will be moz-abldapdirectory://<prefName>          addressbook.deleteAddressBook("moz-abldapdirectory://" +                                        gDeletedDirectories[i]);        }        catch(ex){          dump("Failed to delete the addressbook " + ex + "\n");        }      }      var svc = Components.classes["@mozilla.org/preferences-service;1"]                        .getService(Components.interfaces.nsIPrefService);      svc.savePrefFile(null);    }  }  window.opener.gRefresh = true;  return true;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/7bedc789ce4693f8b68d8f9969c41b7272a65e21/pref-directory.js/clean/mailnews/addrbook/prefs/resources/content/pref-directory.js