rem: function OpenSearch(tabName, forceDialogFlag, searchStr, newWindowFlag) 
add: function OpenSearch(tabName, searchStr, newWindowFlag) 
context: function OpenSearch(tabName, forceDialogFlag, searchStr, newWindowFlag){  //This function needs to be split up someday.  var autoOpenSearchPanel = false;  var defaultSearchURL = null;  var fallbackDefaultSearchURL = gNavigatorRegionBundle.getString("fallbackDefaultSearchURL");  ensureSearchPref()  //Check to see if search string contains "://" or "ftp." or white space.  //If it does treat as url and match for pattern    var urlmatch= /(:\/\/|^ftp\.)[^ \S]+$/   var forceAsURL = urlmatch.test(searchStr);  try {    autoOpenSearchPanel = pref.getBoolPref("browser.search.opensidebarsearchpanel");    defaultSearchURL = pref.getComplexValue("browser.search.defaulturl",                                            Components.interfaces.nsIPrefLocalizedString).data;  } catch (ex) {  }  // Fallback to a default url (one that we can get sidebar search results for)  if (!defaultSearchURL)    defaultSearchURL = fallbackDefaultSearchURL;  if (!searchStr) {    BrowserSearchInternet();  } else {    //Check to see if location bar field is a url    //If it is a url go to URL.  A Url is "://" or "." as commented above    //Otherwise search on entry    if (forceAsURL) {       BrowserLoadURL()    } else {      var searchMode = 0;      try {        searchMode = pref.getIntPref("browser.search.powermode");      } catch(ex) {      }      if (forceDialogFlag || searchMode == 1) {        // Use a single search dialog        var windowManager = Components.classes["@mozilla.org/appshell/window-mediator;1"]                                      .getService(Components.interfaces.nsIWindowMediator);        var searchWindow = windowManager.getMostRecentWindow("search:window");        if (!searchWindow) {          openDialog("chrome://communicator/content/search/search.xul", "SearchWindow", "dialog=no,close,chrome,resizable", tabName, searchStr);        } else {          // Already had one, focus it and load the page          searchWindow.focus();          if ("loadPage" in searchWindow)            searchWindow.loadPage(tabName, searchStr);        }      } else {        if (searchStr) {          var escapedSearchStr = encodeURIComponent(searchStr);          defaultSearchURL += escapedSearchStr;          var searchDS = Components.classes["@mozilla.org/rdf/datasource;1?name=internetsearch"]                                   .getService(Components.interfaces.nsIInternetSearchService);          searchDS.RememberLastSearchText(escapedSearchStr);          try {            var searchEngineURI = pref.getCharPref("browser.search.defaultengine");            if (searchEngineURI) {                        var searchURL = getSearchUrl("actionButton");              if (searchURL) {                defaultSearchURL = searchURL + escapedSearchStr;               } else {                searchURL = searchDS.GetInternetSearchURL(searchEngineURI, escapedSearchStr, 0, 0, {value:0});                if (searchURL)                  defaultSearchURL = searchURL;              }            }          } catch (ex) {          }          if (!newWindowFlag)            loadURI(defaultSearchURL);          else            window.open(defaultSearchURL, "_blank");        }      }    }  }  // should we try and open up the sidebar to show the "Search Results" panel?  if (autoOpenSearchPanel)    RevealSearchPanel();}
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/0315891bf91588c1a50d55a08a7e879136971a10/navigator.js/buggy/xpfe/browser/resources/content/navigator.js