home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 June / Chip_2004-06_cd2.bin / officexp / download / info_soubory / uplevel.js < prev    next >
Text File  |  2004-04-08  |  2KB  |  67 lines

  1.  
  2. // alert("uplevel_js Start");
  3.  
  4. function gsfxUpLevel()
  5. {
  6.     window.onresize = gsfxUplevelResize;
  7.     gsfxUplevelResize();
  8. }
  9.  
  10. function flyout_onwindowresize_hookup(){} //see common/script/gsfx/flyout-rtl.htc
  11.  
  12. function gsfxUplevelResize()
  13. {
  14.     var FlyoutMenu = document.getElementById("idFlyoutMenu");
  15.     var Toolbar = document.getElementById("idToolbar");
  16.     var TopPanel = document.getElementById("TopPanel");    
  17.     var MSMenu = document.getElementById("idMSMenuPane");
  18.     var ToolbarSpacer = document.getElementById("idSpace1");
  19.     var BannerPanel = document.getElementById("BannerPanel");
  20.     var Center = document.getElementById("CenterPanel");
  21.     var Bottom = document.getElementById("BottomPanel");
  22.     
  23.     if(FlyoutMenu){ flyout_onwindowresize_hookup(); }
  24.     
  25.     if(navigator.userAgent.indexOf("Gecko") < 0) {
  26.         if(TopPanel) {
  27.                 var available = document.body.clientHeight;
  28.                 var used=0;
  29.                 if (Toolbar) used = used + Toolbar.clientHeight;
  30.                 if (Bottom)  used = used + Bottom.clientHeight;
  31.                 if (BannerPanel) used = used + BannerPanel.clientHeight;
  32.                 Center.style.height = Math.max(available, used) - used;
  33.                 if(MSMenu) resizeToolbar();
  34.         }
  35.         // adjust banner and footer width
  36.         if(BannerPanel && Center) {
  37.             BannerPanel.style.width = Center.clientWidth;
  38.         }
  39.         if(Bottom && Center) {
  40.             Bottom.style.width = Center.clientWidth;
  41.         }
  42.     } else {
  43.         if(TopPanel) {
  44.                 var available = window.innerHeight;
  45.                 var used=0;
  46.                 if (TopPanel) used = used + TopPanel.offsetHeight;
  47.                 if (Bottom)  used = used + Bottom.offsetHeight;
  48.                 if (BannerPanel) used = used + BannerPanel.offsetHeight;
  49.                 Center.style.height = Math.max(available, used) - used;
  50.             //    resizeToolbar();
  51.         }
  52.         
  53.         // adjust banner and footer width
  54. /*        if(BannerPanel) {
  55.             BannerPanel.style.width = Center.offsetWidth;
  56.         }
  57.         if(Bottom) {
  58.             Bottom.style.width = Center.offsetWidth;
  59.         }
  60. */    
  61.     }
  62.     // if search is there, call it's resize  event as well.
  63.     if(document.calcsearchdivsizes) {
  64.         document.calcsearchdivsizes();
  65.     }
  66.  
  67. }