rem:  if (!tree) return;  
context: function themeSelect(){  var tree = document.getElementById("skinsTree");  if (!tree)    return;  var selectedItem = tree.selectedItems.length ? tree.selectedItems[0] : null;  var applyButton = document.getElementById("applySkin");  if (selectedItem && selectedItem.getAttribute("skin") == "true") {    var themeName = selectedItem.getAttribute("displayName");    var skinName = selectedItem.getAttribute("name");    var oldTheme;    try {      oldTheme = !chromeRegistry.checkThemeVersion(skinName);    }    catch(e) {      oldTheme = false;    }    var nameField = document.getElementById("displayName");    var author = document.getElementById("author");    var image = document.getElementById("previewImage");    var descText = document.createTextNode(selectedItem.getAttribute("description"));    var description = document.getElementById("description");    var uninstallButton = document.getElementById("uninstallSkin");    var applyLabel = gPrefutilitiesBundle.getString("applyThemePrefix");    var uninstallLabel = gPrefutilitiesBundle.getString("uninstallThemePrefix");    while (description.hasChildNodes())      description.removeChild(description.firstChild);    nameField.setAttribute("value", themeName);    author.setAttribute("value", selectedItem.getAttribute("author"));    image.setAttribute("src", selectedItem.getAttribute("image"));    if (!oldTheme) {          description.appendChild(descText);      applyButton.removeAttribute("disabled");      applyLabel = applyLabel.replace(/%theme_name%/, themeName);      uninstallLabel = uninstallLabel.replace(/%theme_name%/, themeName);      applyButton.label = applyLabel;      uninstallButton.label = uninstallLabel;      var locType = selectedItem.getAttribute("loctype");      uninstallButton.disabled = (locType == "install");    }    else{      applyLabel = gPrefutilitiesBundle.getString("applyThemePrefix");      applyLabel = applyLabel.replace(/%theme_name%/, themeName);      applyButton.label = applyLabel;      uninstallLabel = uninstallLabel.replace(/%theme_name%/, themeName);      uninstallButton.label = uninstallLabel;      applyButton.setAttribute("disabled", true);      uninstallButton.disabled = false;      var newText = gPrefutilitiesBundle.getString("oldTheme");      newText = newText.replace(/%theme_name%/, themeName);            newText = newText.replace(/%brand%/g, gBrandBundle.getString("brandShortName"));      descText = document.createTextNode(newText);      description.appendChild(descText);    }  }  else {    applyButton.setAttribute("disabled", true);  }}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/5da2720a05216525ca19696cc65655ea50f0ba9a/pref-themes.js/buggy/xpfe/components/prefwindow/resources/content/pref-themes.js