rem: var treeNode = document.getElementById("NC:SearchEngineRoot"); 
add: var treeNode = document.getElementById("searchengines"); 
context: function unloadPage(){	try	{		var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();		if (rdf)   rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);		if (rdf)		{			var localStore = rdf.GetDataSource("rdf:local-store");			if (localStore)			{				// remember last selected list of search engines				var treeNode = document.getElementById("NC:SearchEngineRoot");				var treeChildrenNode = null;				var numChildren = treeNode.childNodes.length;				for (var x = 0; x<numChildren; x++)				{					if (treeNode.childNodes[x].tagName == "treechildren")					{						treeChildrenNode = treeNode.childNodes[x];						break;					}				}				if (treeChildrenNode != null)				{					var numEngines = treeChildrenNode.childNodes.length;					dump("unloadPage(): " + numEngines + " engines.\n");					var checkedProperty = rdf.GetResource("http://home.netscape.com/NC-rdf#checked", true);					var trueLiteral = rdf.GetLiteral("true");					var checkedFlag = false;					for (var x = 0; x<numEngines; x++)					{						var treeItem = treeChildrenNode.childNodes[x];						if (!treeItem)						{							dump("unloadPage(): Huh? treeitem is null.\n");							continue;						}												checkedFlag = false;						if (treeItem.childNodes[0].childNodes[0].childNodes[0].checked == true)						{							checkedFlag = true;						}						else if (treeItem.childNodes[0].childNodes[0].childNodes[0].getAttribute("checked") == "1")						{							checkedFlag = true;						}						var engineURI = treeItem.getAttribute("id");						var src = rdf.GetResource(engineURI, true);						if (checkedFlag == true)						{							dump("unloadPage(): Saving '" + engineURI + "'\n");							localStore.Assert(src, checkedProperty, trueLiteral, true);						}						else						{							// unassert it just in case its in the localstore, as we don't want to remember it							localStore.Unassert(src, checkedProperty, trueLiteral, true);						}					}					// XXX for now, need to force a flush					flushableStore = localStore.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);					if (flushableStore)					{						flushableStore.Flush();					}				}			}		}	}	catch(ex)	{		dump("\nunloadPage(): Exception.\n");	}}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/e796481a8fae2e00713b26dbcb7c982c76ba9876/internet.js/buggy/xpfe/components/search/resources/internet.js