rem: var ds = document.getElementById("Tree").database; 
add: var ds = document.getElementById("resultList").database; 
context: function switchTab(aPageIndex){  var deck = document.getElementById("advancedDeck");  deck.setAttribute("selectedIndex", aPageIndex);  // decide whether to show/hide/enable/disable save search query button  if (aPageIndex != 0)    return;  var ds = document.getElementById("Tree").database;  if (!ds)    return;  var haveSearchRef = false;  var rdf = Components.classes[RDFSERVICE_CONTRACTID].getService(nsIRDFService);  // look for last search URI  var source = rdf.GetResource("NC:LastSearchRoot", true);  var childProperty = rdf.GetResource("http://home.netscape.com/NC-rdf#ref", true);  var target = ds.GetTarget(source, childProperty, true);  if (target) {    target = target.QueryInterface(nsIRDFLiteral).Value;    if (target)      haveSearchRef = true;  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/d38a0937d9c93a0a9d913e2ac781e4328bb8cc73/search-panel.js/buggy/xpfe/components/search/resources/search-panel.js