rem: var stopButtonNode = document.getElementById("stopbutton"); if (stopButtonNode) { stopButtonNode.setAttribute("style", "display: none;"); 
add: var stopButtonNode = document.getElementById("stopButton"); stopButtonNode.setAttribute("hidden", "true");  var searchButtonNode = document.getElementById("searchButton"); searchButtonNode.removeAttribute("hidden");   var progressNode = parent.document.getElementById("statusbar-icon"); if (progressNode) progressNode.setAttribute("mode", "normal");   var internetSearchService = Components.classes[ISEARCH_CONTRACTID].getService(nsIInternetSearchService); internetSearchService.Stop();   var navWindow = getNavigatorWindow(false); var resultsTree = navWindow ? navWindow._content.document.getElementById("internetresultstree") : null; if (!resultsTree) return;  var searchURL = resultsTree.getAttribute("ref"); if (!searchURL) return;  var internetSearch = internetSearchService.QueryInterface(nsIRDFDataSource);   var rdf = Components.classes[RDFSERVICE_CONTRACTID].getService(nsIRDFService);  var searchResource       = rdf.GetResource(searchURL, true); var priceProperty        = rdf.GetResource("http: var availabilityProperty = rdf.GetResource("http: var relevanceProperty    = rdf.GetResource("http: var dateProperty         = rdf.GetResource("http: var trueProperty         = rdf.GetLiteral("true"); var hasPriceFlag         = internetSearch.HasAssertion(searchResource, priceProperty, trueProperty, true); var hasAvailabilityFlag  = internetSearch.HasAssertion(searchResource, availabilityProperty, trueProperty, true); var hasRelevanceFlag     = internetSearch.HasAssertion(searchResource, relevanceProperty, trueProperty, true); var hasDateFlag          = internetSearch.HasAssertion(searchResource, dateProperty, trueProperty, true); var colNode; var sortSetFlag = false;  if (hasPriceFlag) { colNode = navWindow._content.document.getElementById("PriceColumn"); if (colNode) { colNode.removeAttribute("hidden"); if (!sortSetFlag) { top._content.setInitialSort(colNode, "ascending"); sortSetFlag = true; } 
context: function doStop(){	var stopButtonNode = document.getElementById("stopbutton");    if (stopButtonNode)    {		stopButtonNode.setAttribute("style", "display: none;");    }	var searchButtonNode = document.getElementById("searchbutton");	if(searchButtonNode)	{		searchButtonNode.setAttribute("style", "display: inherit;");	}	// should stop button press also stop the load of the page in the browser? I think so. 	var progressNode = parent.document.getElementById("statusbar-icon");    if (progressNode)    {		progressNode.setAttribute("mode", "normal");    }	// stop any network connections    var internetSearchService = Components.classes[ISEARCH_CONTRACTID].getService(nsIInternetSearchService);    var internetSearch = null;    if (internetSearchService)    {        internetSearchService.Stop();        internetSearch = internetSearchService.QueryInterface(nsIRDFDataSource);    }	// get various services    var rdf = Components.classes[RDFSERVICE_CONTRACTID].getService(nsIRDFService);	var sortSetFlag = false;	// show appropriate column(s)	if ((rdf) && (internetSearch))	{    var navWindow = getNavigatorWindow(false);    var resultsTree = navWindow ? navWindow._content.document.getElementById("internetresultstree") : null;		if (!resultsTree) return false;		var searchURL = resultsTree.getAttribute("ref");		if (!searchURL) return false;			var searchResource       = rdf.GetResource(searchURL, true);		var priceProperty        = rdf.GetResource("http://home.netscape.com/NC-rdf#Price", true);		var availabilityProperty = rdf.GetResource("http://home.netscape.com/NC-rdf#Availability", true);		var relevanceProperty    = rdf.GetResource("http://home.netscape.com/NC-rdf#Relevance", true);		var dateProperty         = rdf.GetResource("http://home.netscape.com/NC-rdf#Date", true);		var trueProperty         = rdf.GetLiteral("true");		var hasPriceFlag         = internetSearch.HasAssertion(searchResource, priceProperty, trueProperty, true);		var hasAvailabilityFlag  = internetSearch.HasAssertion(searchResource, availabilityProperty, trueProperty, true);		var hasRelevanceFlag     = internetSearch.HasAssertion(searchResource, relevanceProperty, trueProperty, true);		var hasDateFlag          = internetSearch.HasAssertion(searchResource, dateProperty, trueProperty, true);    var navWindow = getNavigatorWindow(false);		if(hasPriceFlag)		{			var colNode = navWindow._content.document.getElementById("PriceColumn");			if (colNode)			{				colNode.removeAttribute("style", "width: 0; visibility: collapse;");				if (!sortSetFlag)				{					top._content.setInitialSort(colNode, "ascending");					sortSetFlag = true;				}			}		}		if (hasAvailabilityFlag)		{			colNode = navWindow._content.document.getElementById("AvailabilityColumn");			if (colNode)				colNode.removeAttribute("style", "width: 0; visibility: collapse;");		}		if (hasDateFlag)		{			colNode = navWindow._content.document.getElementById("DateColumn");			if (colNode)				colNode.removeAttribute("style", "width: 0; visibility: collapse;");		}		if (hasRelevanceFlag)		{			colNode = navWindow._content.document.getElementById("RelevanceColumn");			if (colNode)			{				colNode.removeAttribute("style", "width: 0; visibility: collapse;");				if (!sortSetFlag)				{					navWindow._content.setInitialSort(colNode, "descending");					sortSetFlag = true;				}			}		}	}	if (!sortSetFlag)	{		colNode = navWindow._content.document.getElementById("PageRankColumn");		if (colNode)			navWindow._content.setInitialSort(colNode, "ascending");	}	switchTab(0);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/c837d8cd69e2d1c5d2619fe01ec4c3979b2e5f7e/search-panel.js/buggy/suite/common/search/search-panel.js