rem: var directoriesList =  document.getElementById("directoriesList"); 
context: function LoadDirectories(popup){  var children;  var enabled = false;  var description = "";  var item;  var formElement;  var j=0;  var arrayOfDirectories = null;  var position = 0;  var dirType = 1;  if (!gPrefInt) {     try {      gPrefInt = Components.classes["@mozilla.org/preferences;1"];      gPrefInt = gPrefInt.getService(Components.interfaces.nsIPref);    }    catch (ex) {      gPrefInt = null;    }  }  children = gPrefInt.CreateChildList("ldap_2.servers");  if (children && !gAvailDirectories) {    arrayOfDirectories = children.split(';');    gAvailDirectories = new Array();    for (var i=0; i<arrayOfDirectories.length; i++)    {      if ((arrayOfDirectories[i] != "ldap_2.servers.pab") &&         (arrayOfDirectories[i] != "ldap_2.servers.history")) {        try{          position = gPrefInt.GetIntPref(arrayOfDirectories[i]+".position");        }        catch(ex){          position = 1;        }        try{          dirType = gPrefInt.GetIntPref(arrayOfDirectories[i]+".dirType");        }        catch(ex){          dirType = 1;        }        if ((position != 0) && (dirType == 1)) {          try{            description = gPrefInt.CopyUnicharPref(arrayOfDirectories[i]+".description");          }          catch(ex){            description="";          }          if (description != "") {            if (popup) {              item=document.createElement("menuitem");              item.setAttribute("label", description);              item.setAttribute("value", arrayOfDirectories[i]);              popup.appendChild(item);            }            gAvailDirectories[j] = new Array(2);            gAvailDirectories[j][0] = arrayOfDirectories[i];            gAvailDirectories[j][1] = description;            j++;          }        }      }    }    if (popup && !gFromGlobalPref)     {      item=document.createElement("menuitem");      var addressBookBundle = document.getElementById("bundle_addressBook");      var directoryName = addressBookBundle.getString("directoriesListItemNone");      item.setAttribute("label", directoryName);      item.setAttribute("value", "");      popup.appendChild(item);      if (gRefresh)        setupDirectoriesList();    }    if (popup && gFromGlobalPref) {      var pref_string_title = "ldap_2.autoComplete.directoryServer";      try {        var directoryServer = gPrefInt.CopyCharPref(pref_string_title);      }      catch (ex)      {        directoryServer = "";      }      if (directoryServer != "")      {        pref_string_title = directoryServer + ".description";        try {          description = gPrefInt.CopyUnicharPref(pref_string_title);        }        catch (ex) {          description = "";        } 	  }	  var directoriesList =  document.getElementById("directoriesList");      if ((directoryServer != "") && (description != ""))      {        directoriesList.label = description;        directoriesList.value = directoryServer;      }      else if(gAvailDirectories.length >= 1) {         directoriesList.label = gAvailDirectories[0][1];         directoriesList.value = gAvailDirectories[0][0];      }      else {        directoriesList.label = "";        directoriesList.value = null;      }	}  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/bd468c0ddeed02897c0ce6e1cfb0841967f30cab/pref-directory.js/buggy/mailnews/addrbook/prefs/resources/content/pref-directory.js