  // BODYSTART.JS

  // The code to change the margins and get the WindowsInnerWidth for IE4Plus is also
  // deliberately placed AFTER the body tag. IE4Plus requires this for the WindowsInnerWidth
  // calculation. This code also handles the reroute code to a different page if required

  // On systems set for 1024 or higher screen resolution, if the WindowsInnerWidth is less
  // than 600 pixels wide then the normal stylesheet is dynamically written so that the 
  // increased font size style sheet is overridden where the window is too narrow for this
  // increased font size with the minimum width.

  // Plus there is a check for the width of the page and the dynamic top margin spacer.

  // THERE IS ALSO CODE WHICH IS UNIQUE TO THIS PARTICULAR TYPE OF HEADER AND CHANGES
  // HOW MUCH THE HEADERS PAGE NAME/DESCRIPTION TAG IS INDENTED DEPENDING ON THE
  // BROWSER SIZE.

  // This section can also contain any other code that is required at the very beginning
  // of the body section.

  // MinBrowserReq is tested first to make sure that the external JavaScript code has been
  // successfully loaded and compiled, unless ImageSwapAndPreloadSupported is all that is
  // required.

  // Older IE Browsers such as IE 4 and IE 5.5 (strangely enough IE 5.0 is OK, along with IE 6+
  // browsers) need to read the WindowsInnerWidth, etc, AFTER the Body tag has been written.
  // So the function is called once again here if the WindowsInnerWidth was not previously found
  // (i.e. it still has the original default value of zero).
  if (MinBrowserReq)
    {
     if (WindowsInnerWidth == 0)
       {
        GetThisWindowsInnerSizes();
       };
     if (WindowsInnerWidth == 0)
       {
        MinBrowserReq = false;
       };
     if (MinBrowserReq)    
       {
        AdjustMarginsDynamically();
       };
    };

  // If this is in a frame and not Netscape 4 and the frames inner width is less than
  // MinWidthToShowMenuIfSideBySideFrames, then remove the frames and make this page fill
  // the entire browser viewing area. Netscape 4 has a habit of loosing the JavaScript and
  // style sheets when the page is rerouted because it is too small, so it is ignored. 
  //
  // MinBrowserReq is tested first to make sure that the external JavaScript code has been
  // successfully loaded and compiled.

  if (MinBrowserReq)
    {
     if (ThisFrameIsWithinItsOwnWebSitesCoFrameSet)
       {
        if ((WindowsInnerWidth > 0) && (WindowsInnerWidth < MinWidthToShowMenuIfSideBySideFrames))
          {
           if (!Netscape4Only)
             {
              // Parent is used below as Top and Replace causes cross web site problems under
              // Netscape 4 and 6 (i.e. under VCNet frames, etc).
              parent.location.href = self.location;
             }; 
          };
       };
    };
  // This code is only used on sites with a fixed frameset.  If the content page is not in
  // a frame but the browser width is wide enough, then restore the frameset, where supported.
  //
  if (MinBrowserReq)
    {
     if ((self == top) && (ThisSiteUsesFrames) && (WebSitePredefinedStartingFrameFormat != "InlineFramesFloatingLeftMenu"))
       {
        if ((MinWidthToShowMenuIfSideBySideFrames > 0) && (SideBySideNonContentFramesTotalWidth > 0) && (WindowsInnerWidth > (MinWidthToShowMenuIfSideBySideFrames + SideBySideNonContentFramesTotalWidth) + 5) && (!Netscape4Only))
          {
           if (ThisPageNameShort > "")
             {
              if (MenuShownFrameset > "")
                {
                  // Now go ahead and reroute the page to be shown within the proper frameset.
                  var passedurl = MenuShownFrameset;
                  self.location.replace(passedurl);
                 };
             } else {
                     if (MainURLIfRerouteThePage > "")
                       {
                         self.location.replace(MainURLIfRerouteThePage);
                       };
                    };
          };
       };
    };

  // MinBrowserReq is tested first to make sure that the external JavaScript code has been
  // successfully loaded and compiled.
  if (MinBrowserReq)
    {
     // On content pages, the top margin is dynamically changed depending on the current
     // screen resolution. If it is an older browser version or has no script support then
     // the top margin consists of the height specified after this code is called (which is
     // there for older and noscript browsers) plus any margin height specified in the calling
     // frameset plus the additional height of the spacers that are added below. Even more
     // pixels are added to the top margin if the inner height is greater than or equal to 500.
     // The additional top margin heights added below are based on the values of the
     // TopMarginAdditionIfInnerHtIsLessThan500 and the TopMarginAdditionIfInnerHtIsOver500
     // variables that are specified in the global sitewide.js file.
 
     if ((WindowsInnerHeight) && (parseInt(TopMarginAdditionIfInnerHtIsOver500) > 0) && (parseInt(TopMarginAdditionIfInnerHtIsLessThan500) > 0))
       {
        if (WindowsInnerHeight >= 500)
          {
           if ((parseInt(TopMarginAdditionIfInnerHtIsOver500)) > 0)
             {
              document.write ('<div class=\"DynamicDisplayMode\"><span class=\"CustomVerticalSpacing\"><img src=\"' + WebSiteHomePathFilePrefix + 'images\/spacer.gif\" border=\"0\" width=\"100\" height=\"' + parseInt(TopMarginAdditionIfInnerHtIsOver500) + '\" alt=\"\" \/><br \/><\/span><\/div>');
             };
          } else {
                  if ((parseInt(TopMarginAdditionIfInnerHtIsLessThan500)) > 0)
                    {
                     document.write ('<div class=\"DynamicDisplayMode\"><span class=\"CustomVerticalSpacing\"><img src=\"' + WebSiteHomePathFilePrefix + 'images\/spacer.gif\" border=\"0\" width=\"100\" height=\"' + parseInt(TopMarginAdditionIfInnerHtIsLessThan500) + '\" alt=\"\" \/><br \/><\/span><\/div>');
                    };
                 };
       };
    };

  // THIS CODE IS UNIQUE TO THIS PARTICULAR TYPE OF HEADER AND CHANGES HOW MUCH THE 
  // HEADERS PAGE NAME/DESCRIPTION TAG IS INDENTED DEPENDING ON THE BROWSER SIZE.
  // 
  MoveTagOverExtraSpacing = 0; // default size before tests below

  if (MinBrowserReq)
    {
     if (WindowsInnerWidth < 480)
       {
        MoveTagOverExtraSpacing = 0;
       };
     if ((WindowsInnerWidth >= 480) && (WindowsInnerWidth < 550))
       {
        // Typical WindowsInnerWidth with no menu frame and minimum supported width at
        // 800 x600 resolution is 530. That's 480 plus 2 times 25 margin size.
        WindowsInnerWidthOver800Resolution = WindowsInnerWidth - 480;
        MoveTagOverExtraSpacing = WindowsInnerWidthOver800Resolution * .22;
        MoveTagOverExtraSpacing = parseInt(MoveTagOverExtraSpacing);
       };
     if ((WindowsInnerWidth >= 550) && (WindowsInnerWidth < 700))
       {
        MoveTagOverExtraSpacing = 32;
       };
     if ((WindowsInnerWidth >= 700) && (WindowsInnerWidth < 850))
       {
        MoveTagOverExtraSpacing = 40;
       };
     if (WindowsInnerWidth >= 850)
       {
        MoveTagOverExtraSpacing = 43;
       };
   };

  // On systems set for 1024 or higher screen resolution, if the WindowsInnerWidth is less
  // than 600 pixels wide then the normal stylesheet is dynamically written so that the 
  // increased font size style sheet is overridden where the window is too narrow for this
  // increased font size with the minimum width.  Similarly if the screen resolution is 1280
  // or higher then the 1024 style sheet is used when the size of the window is too small
  // for the larger font sizes.

  if (MinBrowserReq)
    {
     if ((window.screen) && (window.screen.width) && (screen.width >= 1024))
       {
        if (WindowsInnerWidth)
          {
           if ((WindowsInnerWidth >= 20) && (WindowsInnerWidth <= 600))
             {
              // The WindowsInnerWidth exists, is valid and the current
              // windows inner width is larger than 600 wide. This is
              // based on real tests based on the LARGER default font
              // size and the minimum width.

              document.write ('<link rel=\"stylesheet\" href=\"' + WebSiteHomePathFilePrefix + 'css\/' + CompanyNamePagePrefix + '_stylesht.css\" type=\"text\/css\" \/>');
             };
           if ((WindowsInnerWidth >= 20) && (WindowsInnerWidth > 600) && (WindowsInnerWidth <= 725) && (screen.width >= 1280))
             {
              // The WindowsInnerWidth exists, is valid and the current
              // windows inner width is larger than 600 wide. This is
              // based on real tests based on the LARGER default font
              // size and the minimum width.

              document.write ('<link rel=\"stylesheet\" href=\"' + WebSiteHomePathFilePrefix + 'css\/' + CompanyNamePagePrefix + '_stylesht1024.css\" type=\"text\/css\" \/>');
             };

          };
       };
    };
