rem: var treeNode = document.getElementById("NC:SearchEngineRoot"); 
add: var treeNode = document.getElementById("searchengines"); 
context: function loadPage(){	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)			{				// XXX activate 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("LoadPage(): " + numEngines + " engines.\n");					var checkedProperty = rdf.GetResource("http://home.netscape.com/NC-rdf#checked", true);					for (var x = 0; x<numEngines; x++)					{						var treeItem = treeChildrenNode.childNodes[x];						if (!treeItem)	continue;						var engineURI = treeItem.getAttribute("id");						var src = rdf.GetResource(engineURI, true);						var target = localStore.GetTarget(src, checkedProperty, true);						if (target)	target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);						if (target)	target = target.Value;						if (target == "true")						{							dump("loadPage(): Checking '" + engineURI + "\n");							treeItem.childNodes[0].childNodes[0].childNodes[0].checked = true;							treeItem.childNodes[0].childNodes[0].childNodes[0].setAttribute("checked", "1");						}					}				}			}		}	}	catch(ex)	{		dump("\nloadPage(): Exception.\n");	}	// check and see if we need to do an automatic search	if (window.parent)	{		var searchText = window.parent.getSearchText();		if (searchText)		{			var textNode = document.getElementById("searchtext");			if (textNode)			{				textNode.setAttribute("value", searchText);				doSearch();			}		}	}}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/e796481a8fae2e00713b26dbcb7c982c76ba9876/internet.js/buggy/xpfe/components/search/resources/internet.js