rem: var ds = document.getElementById("Tree").database; 
add: var ds = document.getElementById("resultList").database; 
context: function saveSearch(){  var ds = document.getElementById("Tree").database;  if (!ds)    return;  var lastSearchURI = "";  var lastSearchText = "";  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)      lastSearchURI = target;  }  // look for last search text  childProperty = rdf.GetResource("http://home.netscape.com/NC-rdf#LastText", true);  target = ds.GetTarget(source, childProperty, true);  if (target) {    target = target.QueryInterface(nsIRDFLiteral).Value;    if (target) {      // convert plusses (+) back to spaces      target = target.replace(/+/g, " ");      lastSearchText = unescape(target);    }  }  if (!lastSearchURI)    return;  // rjc says: if lastSearchText is empty/null, that's still OK, synthesize the text  if (!lastSearchText) {    lastSearchText = lastSearchURI;    var siteOffset = lastSearchText.indexOf("://");    if (siteOffset > 0) {      siteOffset += 3;      var endOffset = lastSearchText.indexOf("/", siteOffset);      if (endOffset > 0)        lastSearchText = lastSearchText.substr(0, endOffset+1);    }  }  var searchTitle = searchBundle.stringBundle.formatStringFromName(                      "searchTitle", [lastSearchText], 1);  var bmks = Components.classes[BMARKS_CONTRACTID].getService(nsIBookmarksService);  bmks.addBookmarkImmediately(lastSearchURI, searchTitle, bmks.BOOKMARK_SEARCH_TYPE, null);}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/e0d74dbab0591d49321454ee7cde5f57910c4047/search-panel.js/buggy/suite/common/search/search-panel.js