rem:    var searchMode = nsPreferences.getIntPref("browser.search.mode", 0); var mClickCount = nsPreferences.getBoolPref("browser.search.use_double_clicks", false) ? 2 : 1;   var tree = document.getElementById("Tree"); if (mClickCount == 1) tree.setAttribute("singleclick","true"); else tree.removeAttribute("singleclick");  
context: function doSearch(){  var searchButton = document.getElementById("searchbutton");        if (searchButton.disabled) {	   	  var sidebarSearchText = document.getElementById("sidebar-search-text");	  sidebarSearchText.focus();	  return;	}	//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  var searchMode = nsPreferences.getIntPref("browser.search.mode", 0);  var mClickCount = nsPreferences.getBoolPref("browser.search.use_double_clicks", false) ? 2 : 1;  // hack hack hack hack  var tree = document.getElementById("Tree");  if (mClickCount == 1)    tree.setAttribute("singleclick","true");  else    tree.removeAttribute("singleclick");    // hide various columns  var navWindow = getNavigatorWindow(false);  if (navWindow && navWindow._content && navWindow._content.isMozillaSearchWindow) {    colNode = navWindow._content.document.getElementById("RelevanceColumn");    if (colNode)	colNode.setAttribute("style", "width: 0; visibility: collapse;");    colNode = navWindow._content.document.getElementById("PriceColumn");    if (colNode)	colNode.setAttribute("style", "width: 0; visibility: collapse;");    colNode = navWindow._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);	}	var searchURL   = "";	var foundEngine = false;  var engineURIs  = [];  if (searchMode > 0)  {    // in advanced search mode, get selected search engines    // (for the current search category)  	var engineBox = document.getElementById("engineKids");  	if (!engineBox)	return(false);  	for (var x = 0; x<engineBox.childNodes.length; x++)  	{  	  var treeitemNode = engineBox.childNodes[x];      if (!treeitemNode) continue;        var checkboxNode = treeitemNode.firstChild.firstChild.firstChild;      if (!checkboxNode) continue;            if ( checkboxNode.checked == true || checkboxNode.checked == "true")       {        var engineURI = treeitemNode.id;        if (!engineURI)	continue;        engineURIs[engineURIs.length] = engineURI;        foundEngine = true;      }    }    if (!foundEngine)    {      if( getNumEngines() == 1 ) {        // only one engine in this category, check it        var treeitemNode = engineBox.firstChild;        engineURIs[engineURIs.length] = treeitemNode.id;      }      else {        for( var i = 0; i < engineBox.childNodes.length; i++ )        {          var treeitemNode = engineBox.childNodes[i];          var theID = treeitemNode.id;          if( theID.indexOf("NetscapeSearch.src") != -1 )          {            engineURIs[engineURIs.length] = theID;            foundEngine = true;            break;          }        }        if (!foundEngine) {          alert(bundle.GetStringFromName("enterstringandlocation") );          return(false);        }      }  	}  }  	// hide search button	var searchButtonNode = document.getElementById("searchbutton");	if (searchButtonNode)    searchButtonNode.setAttribute("style", "display: none;");		// show stop button	var stopButtonNode = document.getElementById("stopbutton");	if (stopButtonNode)    stopButtonNode.removeAttribute("style", "display: none;");	var progressNode = top.document.getElementById("statusbar-icon");	if (progressNode)    progressNode.setAttribute( "mode", "undetermined" );     // run the search  OpenSearch(textNode.value, engineURIs );  switchTab(0);  return(true);}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/80bc9df5e6e01fb476a458dc4eefcdc6a06519ad/search-panel.js/buggy/xpfe/components/search/resources/search-panel.js