home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 December / CMCD1203.ISO / Software / Freeware / Programare / sharpdevelop / 098setup.exe / $INSTDIR / doc / help / ICSharpCode.SharpUnit.1.2.chm / scroll.js < prev    next >
Encoding:
Text File  |  2003-10-24  |  1000 b   |  40 lines

  1. window.onload = resizeBanner;
  2. window.onresize = resizeBanner;
  3.  
  4. function resizeBanner()
  5. {
  6.     if (document.body.clientWidth == 0) return;
  7.  
  8.     var oBanner= document.all.item("nsbanner");
  9.     var oText = document.all.item("nstext");
  10.  
  11.     if (oText == null) return;
  12.  
  13.     var oBannerRow1 = document.all.item("bannerrow1");
  14.     if (oBannerRow1 != null)
  15.     {
  16.         var iScrollWidth = bodyID.scrollWidth;
  17.         try { oBannerRow1.style.marginRight = 0 - iScrollWidth; }
  18.         catch (e) { return; }
  19.     }
  20.  
  21.     if (oBanner != null)
  22.     {
  23.         try
  24.         {
  25.             document.body.scroll = "no";
  26.             oText.style.overflow = "auto";
  27.              oBanner.style.width = document.body.offsetWidth - 2;
  28.             oText.style.paddingRight = "20px";
  29.             oText.style.width = document.body.offsetWidth - 4;
  30.             oText.style.top = 0;
  31.             
  32.             if (document.body.offsetHeight > oBanner.offsetHeight + 4)
  33.                 oText.style.height = document.body.offsetHeight - (oBanner.offsetHeight + 4);
  34.             else 
  35.                 oText.style.height = 0;
  36.                 
  37.         } catch (e) { return; }
  38.     }    
  39. }
  40.