rem: if( parent.tzDIYdialog ) { 
add: if( tzDIYdialog ) { 
context: function onLoad() {  try {    include('chrome://jslib/content/io/dir.js');    //include('chrome://jslib/content/io/fileUtils.js');  }  catch(ex) {    var page=document.firstChild;    for(var i=0; i<page.childNodes.length; i++) {      if(page.childNodes[i].getAttribute("id") != "noJSlib")        page.childNodes[i].setAttribute("collapsed","true");    }    return;  }  document.getElementById("noJSlib").setAttribute("collapsed","true");  clipSample = document.getElementById("clipSample");  clipPrefix = document.getElementById("tzPref-clipPrefix");  clipSuffix = document.getElementById("tzPref-clipSuffix");  mailSample = document.getElementById("mailSample");  mailPrefix = document.getElementById("tzPref-mailPrefix");  mailSuffix = document.getElementById("tzPref-mailSuffix");  sampleText = clipSample.getAttribute("value");  // Assume the best  haveMail = true;  haveBrowser = true;  // Testing for mail support is easy  try {    gAccountManager = Components      .classes["@mozilla.org/messenger/account-manager;1"]      .getService(Components.interfaces.nsIMsgAccountManager);    var idSupports = gAccountManager.allIdentities;    gIdentities =  queryISupportsArray(idSupports,      Components.interfaces.nsIMsgIdentity);    gIDpopup = document.getElementById("msgIdentity");    // Hide identity list stuff if our prefs service is loaded    // FIXME: is there a better way?    var catman = Components.classes["@mozilla.org/categorymanager;1"].getService(Components.interfaces.nsICategoryManager);    var catStr;    try {      catStr = catman.getCategoryEntry("mailnews-accountmanager-extensions",                            "TagZilla account manager extension");    }    catch(ex2) { }    if( catStr == "@mozilla.org/accountmanager/extension;1?name=tzprefs" ) {      document.getElementById("tzAccounts").setAttribute("collapsed", "true");    }    else    {      FillIdentityListPopup(gIDpopup.childNodes[0]);      setInterval(popupCommand,50);    }  }  catch(ex) {    haveMail = false;    document.getElementById("tzMailNewsTab").setAttribute("collapsed", "true");  }  // Testing for browser support isn't quite so easy --  //  is this guaranteed to fail in Thunderbird?  try {    var browserInstance = Components      .classes['@mozilla.org/appshell/component/browser/instance;1']      .getService(Components.interfaces.nsIBrowserInstance);  }  catch(ex) {    haveBrowser = false;    document.getElementById("tzBrowserTab").setAttribute("collapsed", "true");  }  if( parent.tzDIYdialog ) {    // if we're our own dialog, we have to init our own prefs    for (i = 0; i < _elementIDs.length; i++) {      var curEl = document.getElementById(_elementIDs[i]);      var prefstring = curEl.getAttribute("prefstring");      var preftype = curEl.getAttribute("preftype");      var prefattr = curEl.getAttribute("prefattribute");      var result = readMyPref( prefstring, preftype, null );      if(curEl.localName == "radiogroup") {        for (var x = 0; x < curEl.childNodes.length; x++) {          if(String(curEl.childNodes[x].value) == String(result)) {            curEl.selectedItem = curEl.childNodes[x];            break;          }        }      }      else if(prefattr == "value") {        curEl.value = result;      }      else        curEl.setAttribute(prefattr, result);    }  }  else {    // Otherwise, let Mozilla handle it    parent.initPanel("chrome://tagzilla/content/pref/tagzillaBirdPrefs.xul");  }  // Voodoo taken from ChatZilla to make the charset picker work  const OSBS_CTRID = "@mozilla.org/observer-service;1";  const nsIObserverService = Components.interfaces.nsIObserverService;  var observerService =     Components.classes[OSBS_CTRID].getService(nsIObserverService);  observerService.notifyObservers(null, "charsetmenu-selected", "other");  onMailUpdate();  onClipUpdate();}
meta: 1647	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1647/d2551f35984a552551ffe7f584f99f8f620e2087/tagzillaBirdPrefs.js/clean/src/tagzilla/content/pref/tagzillaBirdPrefs.js