context: function doSearch(){	//get click count pref for later	//and set tree attribute to cause proper results appearance (like links) to happen 	//when user set pref to single click  try {    if( pref ) {      var prefvalue = pref.GetBoolPref( "browser.search.use_double_clicks" );      var mClickCount = prefvalue ? 2 : 1;    }     else      mClickCount = 1;  }  catch(e) {    mClickCount = 1;  }  var tree = document.getElementById("Tree");  if (mClickCount == 1)    tree.setAttribute("singleclick","true");  else    tree.removeAttribute("singleclick");	//end insert for single click appearance		// 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 engineBox = document.getElementById("searchengines");	if (!engineBox)	return(false);	var searchURL   = "";	var foundEngine = false;  var engineURIs  = [];	for (var x = 0; x<engineBox.childNodes.length; x++)	{		var checkbox = engineBox.childNodes[x];		if (!checkbox)			continue;		if ( checkbox.checked == true || checkbox.checked == "true")		{			var engineURI = checkbox.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 checkbox = engineBox.firstChild;      engineURIs[engineURIs.length] = checkbox.getAttribute( "id" );    }    else {      debug("*** multiple search engines present, selecting the netscape search engine\n");      for( var i = 0; i < engineBox.childNodes.length; i++ )      {        var checkbox = engineBox.childNodes[i];        debug("*** the current URI is = " + checkbox.getAttribute("id") + "\n");        if( checkbox.getAttribute("id").indexOf("NetscapeSearch.src") != -1 ) {          engineURIs[engineURIs.length] = checkbox.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 );	switchTab(0);	return true;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/43e537213815fa72f382b6b52d118f4961edfa7f/search-panel.js/buggy/xpfe/components/search/resources/search-panel.js