rem: engineURIs[engineURIs.length] = currItem.getAttribute("id"); 
add: engineURIs[engineURIs.length] = treeItem.getAttribute("id"); 
context: function doSearch(){	// hide search button	var searchButtonNode = document.getElementById("searchbutton");	var stopButtonNode = document.getElementById("stopbutton");	var progressNode = top.document.getElementById("statusbar-icon");	if( !stopButtonNode || !searchButtonNode  )    return;  	// hide various columns  if( parent.content.isMozillaSearchWindow ) {  	colNode = parent.content.document.getElementById("RelevanceColumn");  	if (colNode)	colNode.setAttribute("style", "width: 0; visibility: collapse;");	  colNode = parent.content.document.getElementById("PriceColumn");  	if (colNode)	colNode.setAttribute("style", "width: 0; visibility: collapse;");	  colNode = parent.content.document.getElementById("AvailabilityColumn");  	if (colNode)	colNode.setAttribute("style", "width: 0; visibility: collapse;");  }	// get user text to find	var textNode = document.getElementById("sidebar-search-text");	if( !textNode )	    return false;	if ( !textNode.value )	{    alert( bundle.GetStringFromName("enterstringandlocation") );		return false;	}	// get selected search engines	var treeNode = document.getElementById("searchengines");	if (!treeNode)	return(false);	var numChildren = treeNode.childNodes.length;	for (var x = 0; x<numChildren; x++)	{		if (treeNode.childNodes[x].tagName == "treechildren")		{			var treeChildrenNode = treeNode.childNodes[x];			break;		}	}	if ( !treeChildrenNode )	    return false;	var searchURL   = "";	var foundEngine = false;  var engineURIs  = [];	var numEngines  = treeChildrenNode.childNodes.length;	for (var x = 0; x<numEngines; x++)	{		var treeItem = treeChildrenNode.childNodes[x];		if (!treeItem)			continue;		var checkedFlag = false;    var checkbox = treeItem.firstChild.firstChild.firstChild;		if ( checkbox.checked == true || checkbox.getAttribute("checked") == "1")			checkedFlag = true;		if ( checkedFlag )		{			var engineURI = treeItem.getAttribute("id");			if (!engineURI)	continue;      engineURIs[engineURIs.length] = engineURI;			foundEngine = true;		}	}	if (foundEngine == false)	{    if( getNumEngines() == 1 ) {      // only one engine in this category, check it      var treeItem = treeChildrenNode.firstChild;      engineURIs[engineURIs.length] = treeItem.getAttribute( "id" );    }    else {      dump("*** multiple engines present, none selected, selecting the netscape search engine\n");      for( var i = 0; i < treeChildrenNode.childNodes.length; i++ )      {        var currItem = treeChildrenNode.childNodes[i];          dump("*** the current URI is = " + currItem.getAttribute("id") + "\n");        if( currItem.getAttribute("id").indexOf("NetscapeSearchMain") != -1 ) {                    engineURIs[engineURIs.length] = currItem.getAttribute("id");          break;        }      }    }	}  progressNode.setAttribute( "mode", "undetermined" );  searchButtonNode.setAttribute("style", "display: none;");  stopButtonNode.removeAttribute("style", "display: none;");      // run the search	OpenSearch("internet", false, textNode.value, engineURIs );	return true;}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/04ca04b3979bb3be3600d7740115a314e1831a5a/search-panel.js/buggy/xpfe/components/search/resources/search-panel.js