home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 October / Gamestar_77_2005-10_dvd.iso / Programy / nsb-install-8-0.exe / chrome / browser.jar / content / browser / search / search.js < prev    next >
Encoding:
Text File  |  2005-07-29  |  1.8 KB  |  90 lines

  1.  
  2. var    gSearchStr = "";
  3. var    gTabName = "";
  4.  
  5. function loadPage(thePage, searchStr)
  6. {
  7.     var    content="", results="";
  8.     var    tabName="";
  9.  
  10.     gSearchStr = "";
  11.  
  12.     if (thePage == "find")
  13.     {
  14.         tabName="findTab";
  15.         content="chrome://browser/content/search/find.xul";
  16.         results="chrome://browser/content/search/findresults.xul";
  17.     }
  18.     else if (thePage == "internet")
  19.     {
  20.         tabName="internetTab";
  21.         content="chrome://browser/content/search/internet.xul";
  22.         results="chrome://browser/content/search/internetresults.xul";
  23.  
  24.         if ((searchStr) && (searchStr != null))
  25.         {
  26.             gSearchStr = searchStr;
  27.         }
  28.     }
  29.     else if (thePage == "mail")
  30.     {
  31.         tabName="mailnewsTab";
  32.         content="about:blank";
  33.         results="about:blank";
  34.     }
  35.     else if (thePage == "addressbook")
  36.     {
  37.         tabName="addressbookTab";
  38.         content="about:blank";
  39.         results="about:blank";
  40.     }
  41.  
  42.     if (tabName == gTabName)    return(true);
  43.     gTabName = tabName;
  44.  
  45.     if ((content != "") && (results != ""))
  46.     {
  47.         var    contentFrame = document.getElementById("content");
  48.         if (contentFrame)
  49.         {
  50.             contentFrame.setAttribute("src", content);
  51.         }
  52.         var    resultsFrame = document.getElementById("results");
  53.         if (resultsFrame)
  54.         {
  55.             resultsFrame.setAttribute("src", results);
  56.         }
  57.         var    theTab = document.getElementById(tabName);
  58.         if (theTab)
  59.         {
  60.             theTab.setAttribute("selected", "true");
  61.         }
  62.     }
  63.     return(true);
  64. }
  65.  
  66.  
  67.  
  68. function getSearchText()
  69. {
  70.     return(gSearchStr);
  71. }
  72.  
  73.  
  74.  
  75. function doUnload()
  76. {
  77.     // Get the current window position/size.
  78.     var x = window.screenX;
  79.     var y = window.screenY;
  80.     var h = window.outerHeight;
  81.     var w = window.outerWidth;
  82.  
  83.     // Store these into the window attributes (for persistence).
  84.     var win = document.getElementById( "search-window" );
  85.     win.setAttribute( "x", x );
  86.     win.setAttribute( "y", y );
  87.     win.setAttribute( "height", h );
  88.     win.setAttribute( "width", w );
  89. }
  90.