  // Dynamic Promo Layer 

  // See the notes at the bottom of this file.
 



// START CODE FOR STAND ALONE ONLY (niscode.js replacements)


MarginRangeNetscape4Only = 45; // Same as body tag margin width on calling page

  var ErrorTrappingOn = true; // Set to true or false to toggle error trapping on or off.

  function TrapError() {

    return true;

  };
  if (ErrorTrappingOn != false)
    {
     window.onerror = TrapError;
    };




  var Version4Plus = 
    (((navigator.appName == "Netscape") && 
    (parseInt(navigator.appVersion) >= 4 )) || 
    ((navigator.appName == "Microsoft Internet Explorer") && 
    (parseInt(navigator.appVersion) >= 4 ))); 

  NavUserAgent = navigator.userAgent;
  NavUserAgent = NavUserAgent.toLowerCase();
  NavAppName = navigator.appName;
  NavAppName = NavAppName.toLowerCase();

  var IsWindows = (NavUserAgent.indexOf("win") != -1);

  var IsMac = (NavUserAgent.indexOf("mac") != -1);

  var TrueColors = false; // Default value before calculating color bit depth.
    // Will be changed to true below, if the screen is set for greater than 256 colors.
    // To avoid errors don't attempt to read the screen.colorDepth object unless it is a
    // Version4Plus browser as previously defined at the top of each page.
    if (Version4Plus)
      { 
       if (screen.colorDepth)
         {
          // NOTE: Some Netscape 4.x browsers on 256 colors show a colorDepth of 18 bits.
          if ((screen.colorDepth == 15) || (screen.colorDepth == 16) || (screen.colorDepth == 24) || (screen.colorDepth == 32) || (screen.colorDepth == 64))
            {
             TrueColors = true;
            };
         }; 
      };

  var IsOpera = false; // Default value before testing below.
    if (NavUserAgent.indexOf("opera") != -1)
      {
       IsOpera = true;
      };

  var IsWebTV = false; // Default value before testing below.
    // WebTV is also known as MSNTV and is also offered by Sony.
    // They are all the same.
    if (NavAppName.indexOf("webtv") != -1)
      {
       IsWebTV = true;
      };

  // Detect IE browser and versions. This code also requires the IsOpera code and
  // the IsWebTV above.
  var IsIE = false; // Default value before testing below.
  var IEVersion = 0; // Default value before testing below.
    // Note that IEVersion must end up being a number and not a string.
    if (navigator.appVersion.indexOf("MSIE") != -1)
      {
       // The browser identifies itself as being an IE browser.
       IsIE = true;
       if ((!IsOpera) && (!IsWebTV))
         {
          TheSplitString = navigator.appVersion.split("MSIE");
          // TheSplitString[0] is now the portion of the string before "MSIE".
          // TheSplitString[1] is now the portion of the string after "MSIE".
          IEVersion = parseFloat(TheSplitString[1]);
          // IEVersion is now the first number sequence encountered in the string
          // that follows "MSIE".
          if (isNaN(IEVersion))
            {
             IEVersion = 0;
            };
         };
       if ((IsOpera) || (IsWebTV))
         {
          IsIE = false;
          IEVersion = 0;
         };
       if (IsMac) 
         {
          if ((IEVersion >= 4) && (IEVersion < 5))
            {
             // IE 4 on the Mac is flakey so change the version number to 3.9.
             // The number must be exactly 3.9 due to the FlakeyBrowser testing further down.
             IEVersion = 3.9;
            };
         };
      };


  // Detect Netscape browser and versions. Mozilla 1.0 and higher shows up as
  // Netscape 6 and behaves the same.
  var IsNetscape = (NavAppName.indexOf("netscape") != -1);
  var NetscapeVersion = 0; // Default value before testing below.
    // Note that NetscapeVersion must end up being a number and not a string.
    if (IsNetscape)
      {
       NetscapeVersion = parseFloat(navigator.appVersion);
       if (isNaN(NetscapeVersion))
         {
          NetscapeVersion = 0;
         };
       if (NetscapeVersion == 5)
         {
          NetscapeVersion = 6; // New default value that may change.
          NetSplitStringArray = NavUserAgent.split("/");
          // This now creates an array of each portion of the string before or
          // after each "/" found in the string. NetSplitStringArray[0] is the
          // portion before the first "/", etc.
          // There should be 3 "/"'s which means that the detailed version info
          // (just for Netcape 6+) will follow the last "/".
          if (NetSplitStringArray)
            {  
             if (NetSplitStringArray.length == 4)
               {
                NetscapeVersionNmbr = parseFloat(NetSplitStringArray[3]);
                if (isNaN(NetscapeVersionNmbr))
                  {
                   // If a valid version number was not returned then reset the
                   // default to 6.
                   NetscapeVersionNmbr = 6;
                  } else {
                          if (NetscapeVersionNmbr > 6)
                            {
                             NetscapeVersion = NetscapeVersionNmbr;
                            };
                         };
               };
            };
         };
       if ((NetscapeVersion > 3.99) && (NetscapeVersion < 4.4))
         {
          // Early versions of Netscape 4 are too flakey. As a result those versions
          // are treated as if they are not Netscape 4+ browsers. Version4Plus and
          // isNetscape both stay as true.
          // The number must be exactly 3.9 due to the FlakeyBrowser testing further down.
          NetscapeVersion = 3.9;
         };
       if (IsMac) 
         {
          if ((NetscapeVersion >= 4) && (NetscapeVersion < 5))
            {
             // Netscape 4 on the Mac is flakey so change the version number to 3.9.
             // The number must be exactly 3.9 due to the FlakeyBrowser testing further down.
             NetscapeVersion = 3.9;
            };
         };
      };

  var Netscape4Only = false; // Default value before testing below.
  // This one is explicitly defined due to the large number of !Netscape4Only calls that are
  // made. This is too difficult to program without Netscape4Only being explicitly defined.
  if ((NetscapeVersion >= 4) && (NetscapeVersion < 5))
    {
     Netscape4Only = true;
    };

  var FlakeyBrowser = false;// Default value before testing below.
  if ((NetscapeVersion == 3.9) || (IEVersion == 3.9) || (IsWebTV))
    {
     // There are some functions where Version4Plus is true, but where the function is
     // not appropriate for some borderline browsers. So all version 4 browsers running
     // on a Mac (5 plus are OK), all Netscape 4.0x browsers, and all WebTV/MSN TV browsers
     // are all identified with FlakeyBrowser set to true. This allows for easy testing
     // elsewhere in the code for the major exeptions.  The NetscapeVersion code and the
     // IEVersion code all have previously set these browser versions to exactly 3.9.
     FlakeyBrowser = true;
    };


 // Code to determine the screen's total height and width in pixels.
  // This is only supported by Version4Plus browsers as it crashes on earlier
  // browsers.  This must return a number and not a string.
  // NOTE: This indicates the screen size NOT the browser size on the screen.
  //
  // Known screen resolutions are (width x height - in pixels):
  // Major ones are marked with an asterix.
  // *560x420 (WebTV / MSN TV - Sony Internet TV appliances)
  // *640x480 (Windows and Mac)
  // *800x600 (Windows and Mac)
  // 832x624 (Mac)
  // *1024x768 (Windows and Mac)
  // 1152x864 (Windows)
  // 1152x870 (Mac)
  // *1280x1024 (Windows and Mac)
  // 1280x854 (Mac)
  // 1280x960 (Some Windows) 
  // *1600x1200 (Some Windows)
  // 1600x1024 (Some Windows)
  // 1600x900 (Some Windows)
  //
  var ScreenResWidth = 0; // Default value.
  var ScreenResHeight = 0; // Default value
  // if the value remains 0 after the testing below then the screen size is not known.
  //
  if (Version4Plus)
    {
     if ((screen.width) && (screen.height))
       {
        if (screen.width > 0) 
          {
           ScreenResWidth = screen.width;
          };
        if (isNaN(ScreenResWidth))
          {
           // If the returned value is not a number then replace the value with 0.
           ScreenResWidth = 0;
          };
        if (screen.height > 0) 
          {
           ScreenResHeight = screen.height;
          };
        if (isNaN(ScreenResHeight))
          {
           // If the returned value is not a number then replace the value with 0.
           ScreenResHeight = 0;
          };
       };
    };


  // This function returns the pageWidth and pageHeight variables.  These are the total
  // visible width and height inside the browser window (unless within a fixed frame setting)
  // and ignores margins, iframes, etc. The pageWidth figure only accounts for the visible
  // area before the vertical scroll bar.  On IE browsers this function MUST NOT be called
  // until the body of the page has started loading.
  //
  var pageWidth = 0; // Global declaration with default values before testing.
  var pageHeight = 0;
  function GetPageWidthAndHeight() {

    if (Version4Plus)
      {
       if (!FlakeyBrowser)
         {
          if ((NetscapeVersion >= 4) || (IsOpera))
            {
             if (window.innerWidth)
               {
                pageWidth = parseInt(window.innerWidth);
                if ((NetscapeVersion >= 6) && (pageWidth > 15))
                  {
                   pageWidth = pageWidth - 15;  // Correction for vertical scroll bar width.
                  };
                pageHeight = parseInt(window.innerHeight);
               };
            };
          if (IEVersion >= 4)
            {
             if (document.body)
               {
                if (document.body.clientWidth)
                  {
                   pageWidth = parseInt(document.body.clientWidth);
                   pageHeight = parseInt(document.body.clientHeight);
                  };
               };
            };
          if (document.documentElement)
            {
             if ((document.documentElement.clientWidth) && ((pageWidth == 0) || (pageHeight == 0)))
               {
                // Required for future browsers versions with a strict Doctype DTD.
                pageWidth = parseInt(document.documentElement.clientWidth);
                pageHeight = parseInt(document.documentElement.clientHeight);
               }; 
            };
         };
      };
  };

  // Date functions used by the FullDateString function which is automatically called in this
  // code and creates a global variable named TheFullDateString.
  // Typical JavaScript usage is:
  // document.write (TheFullDateString)
  // which returns something like this:
  // 
  //
  // Create a date array builder.
  function CreateADateArray() {
  
    NmbrOfArguments = CreateADateArray.arguments.length;
    for (var PosIndex = 0; PosIndex < NmbrOfArguments; PosIndex++) 
       {
        this[PosIndex + 1] = CreateADateArray.arguments[PosIndex];
       };
  };
  // Create arrays for months and days.
  // All month and day names have been carefully sized so that the string isn't too large.
  var MonthsArray = new CreateADateArray("Jan.", "Feb.", "March", "April", "May", "June", "July", "Aug.", "Sept.", "Oct.", "Nov.", "Dec.");
  var DaysArray = new CreateADateArray("Monday", "Tuesday", "Wed", "Thursday", "Friday", "Saturday", "Sunday");
  DaysArray[0] = "Sunday";
  function Standardized4DigitYear(TheYear) {

    if (TheYear < 99)
      {
       TheYear = 2000 + TheYear;
      };
    if ((TheYear > 99) && (TheYear < 1000))
      {
       TheYear = 2000 + TheYear - 100;
      };
    return TheYear;	
  };
  function AddTheDateExt(DayNmbr) {

    DateExtension = "th";
    if (DayNmbr == 1 || DayNmbr == 21 || DayNmbr == 31)
      {
       DateExtension = "st";
      };
    if (DayNmbr == 2 || DayNmbr == 22) 
      {
       DateExtension = "nd";
      };
    if (DayNmbr == 3 || DayNmbr == 23)
      {
       DateExtension = "rd";
      };
    DayNmbr = DayNmbr + DateExtension;
    return DayNmbr;	
  };
  var TheFullDateString = ""; // Declare globally before being assigned by the FullDateString.
  function FullDateString() {

    TodaysDate = new Date();
    TheFullDateString = DaysArray[TodaysDate.getDay()];
    TheFullDateString = TheFullDateString + ", ";
    TheFullDateString = TheFullDateString + MonthsArray[TodaysDate.getMonth() + 1];
    TheFullDateString = TheFullDateString + " ";
    TheFullDateString = TheFullDateString + AddTheDateExt(TodaysDate.getDate());
    TheFullDateString = TheFullDateString + ", ";
    TheFullDateString = TheFullDateString + Standardized4DigitYear(TodaysDate.getYear());
  };
  // Now call the FullDateString function to assign the TheFullDateString variable.
  FullDateString();

  // Date comparison functions.
  // This makes use the previously declared Standardized4DigitYear function.
  //
  var TodaysDateAsANumberForEasyComparisons = 0; // Declared globally before being assigned.
  function ConvertTodaysDateToNumberForComparisonPurposes() {

    if (Version4Plus)
      {
       TodaysDateInfo = new Date();
       ThisYear = "" + Standardized4DigitYear(TodaysDateInfo.getYear()); // Get as a string.
       ThisMonthNumber = 1 + TodaysDateInfo.getMonth(); // Get as a number.
       ThisMonth = "" + ThisMonthNumber; // Get as a string.
       if (ThisMonth.length == 1)
         {
          ThisMonth = "0" + ThisMonth; // Make sure that it is a 2 digit string.
         };
       ThisDay = "" + TodaysDateInfo.getDate(); // Get as a string.
       if (ThisDay.length == 1)
         {
          ThisDay = "0" + ThisDay; // Make sure that it is a 2 digit string.
         };
       TodaysDateString = "" + ThisYear + "" + ThisMonth + "" + ThisDay + ""; // Build string.
       TodaysDateAsANumberForEasyComparisons = 1 * TodaysDateString; // Convert to number.
      };
  };
  // Now call the ConvertTodaysDateToNumberForComparisonPurposes function to assign the
  // TodaysDateAsANumberForEasyComparisons variable as a number.
  // For example, May 21 2001 would return a value of: 20010521
  // The numeric order of the elements is deliberate for easy less than, equal to and greater
  // than comparisons.
  ConvertTodaysDateToNumberForComparisonPurposes();
  // 
  // Date comparison function. A typical conditional call dependent on whether todays date is
  // less than or equal to December 31st, 2001 would be:
  // if (IsTodaysDateLessThanOrEqualTo(20011231)
  function IsTodaysDateLessThanOrEqualTo(DateAsNumber) {

    if (Version4Plus)
      {
       if (TodaysDateAsANumberForEasyComparisons < 1)
         {
          ConvertTodaysDateToNumberForComparisonPurposes(); // Not previously called.
         };
       if (TodaysDateAsANumberForEasyComparisons < 1)
         {
          return false; // Not supported.
         };
       // Make sure both values are numeric before doing a numeric comparison.
       if ((1 * TodaysDateAsANumberForEasyComparisons) <= (1 * DateAsNumber))
         {
          return true;
         } else {
                 return false;
                };
      } else {
              return false;
             };
  };
  //
  // Date comparison function. A typical conditional call dependent on whether todays date is
  // greater than February 27, 2000 would be:
  // if (IsTodaysDateGreaterThan(20000227)
  function IsTodaysDateGreaterThan(DateAsNumber) {

    if (Version4Plus)
      {
       if (TodaysDateAsANumberForEasyComparisons < 1)
         {
          ConvertTodaysDateToNumberForComparisonPurposes(); // Not previously called.
         };
       if (TodaysDateAsANumberForEasyComparisons < 1)
         {
          return false; // Not supported.
         };
       // Make sure both values are numeric before doing a numeric comparison.
       if ((1 * TodaysDateAsANumberForEasyComparisons) > (1 * DateAsNumber))
         {
          return true;
         } else {
                 return false;
                };
      } else {
              return false;
             };
  };

  // Get the inner width and height of the current browser. Note the special notes as to where
  // in the code, it should be called from.
  var WindowsInnerWidth = 0; // Defaults declared globally outside the functions below.
  var WindowsInnerHeight = 0;
  function GetThisWindowsInnerSizes() {

    // This function MUST be called by Netscape 4 from within the codes head section.
    // HOWEVER this function MUST be called by IE4+ from within the codes body section.
    // Netscape 6 can call it from either location.

    // NOTE: WindowsInnerHeight assumes no scroll bar at the bottom but WindowsInnerWidth
    // DOES assume that a scroll bar exists on the right side.

    // Assign the default values in case no value is successfully returned

           // These are the correct defaults for CONTENT FRAMES under IE
           // (where the total width of the non content frames is known).
           DefaultInnerWindowWidth560 = 544 - SideBySideNonContentFramesTotalWidth;
           if (DefaultInnerWindowWidth560 < 1) {DefaultInnerWindowWidth560 = 544;};
           DefaultInnerWindowWidth640 = 620 - SideBySideNonContentFramesTotalWidth;
           if (DefaultInnerWindowWidth640 < 1) {DefaultInnerWindowWidth640 = 620;};
           DefaultInnerWindowWidth800 = 780 - SideBySideNonContentFramesTotalWidth;
           if (DefaultInnerWindowWidth800 < 1) {DefaultInnerWindowWidth800 = 780;};
           DefaultInnerWindowWidth1024 = 1004 - SideBySideNonContentFramesTotalWidth;
           if (DefaultInnerWindowWidth1024 < 1) {DefaultInnerWindowWidth1024 = 1004;};
           DefaultInnerWindowWidth1280 = 1260 - SideBySideNonContentFramesTotalWidth;
           if (DefaultInnerWindowWidth1280 < 1) {DefaultInnerWindowWidth1280 = 1260;};
  
    if (Version4Plus)
      {
       if (IEVersion >= 4)
         {
          if (document.body.offsetWidth)
            {
             WindowsInnerWidth = document.body.offsetWidth;
             WindowsInnerHeight = document.body.offsetHeight;
             if (WindowsInnerWidth > 20)
               {
                // The offset width correction for the scroll bar is now added provided that a 
                // valid measurement was actually returned.
                WindowsInnerWidth = WindowsInnerWidth - 20;
               };
             if (WindowsInnerHeight > 2)
               {
                // The offset width correction for the scroll bar is now added provided that a 
                // valid measurement was actually returned.
                WindowsInnerHeight = WindowsInnerHeight - 2;
               };
            };
         } else {
                 if ((NetscapeVersion >= 4) || (IsOpera))
                   {
                    if (window.innerWidth)
                      {
                       WindowsInnerWidth = window.innerWidth;
                       WindowsInnerHeight = window.innerHeight;
                       if ((WindowsInnerWidth) && (NetscapeVersion >= 4))
                         {
                          // The size is adjusted by 16 pixels on Netscape 4.x and 14 pixels 
                          // on Netscape 6.x.  Note this is ONLY done if window.innerWidth 
                          // actually returns a value so that it is still null if it has not
                          // actually been assigned.
                          WindowsInnerWidth = WindowsInnerWidth - 16;
                          if (NetscapeVersion >= 6)
                            {
                             WindowsInnerWidth = WindowsInnerWidth + 2;
                            };
                         };
                      };
                   };
                };
       // Manually set the width variable on any browsers that can't handle the above
       // calculations.
       if ((WindowsInnerWidth <= 0) && (!IsWebTV))
         {
          if (ScreenResWidth > 0)
            {
             // The monitor resolution is known so change the default accordingly.
             if ((ScreenResWidth <= 799) && (DefaultInnerWindowWidth640 > 0))
               {
                WindowsInnerWidth = DefaultInnerWindowWidth640;
               };
             if ((ScreenResWidth > 799) && (ScreenResWidth <= 1023) && (DefaultInnerWindowWidth800 > 0))
               {
                WindowsInnerWidth = DefaultInnerWindowWidth800;
               };
             if ((ScreenResWidth > 1023) && (ScreenResWidth <= 1279) && (DefaultInnerWindowWidth1024 > 0))
               {
                WindowsInnerWidth = DefaultInnerWindowWidth1024;
               };
             if ((ScreenResWidth > 1279) && (DefaultInnerWindowWidth1280 > 0))
               {
                WindowsInnerWidth = DefaultInnerWindowWidth1280;
               };
            };
          };
       // Manually set the height variable on any browsers that can't handle the above
       // calculations.
       if ((WindowsInnerHeight <= 0) && (!IsWebTV))
         {
          if (ScreenResHeight > 0)
            {
             // The monitor resolution is known so change the default accordingly.
             if ((ScreenResHeight <= 599) && (DefaultInnerWindowHeight480 > 0))
               {
                WindowsInnerHeight = DefaultInnerWindowHeight480;
               };
             if ((ScreenResHeight > 599) && (ScreenResHeight <= 767) && (DefaultInnerWindowHeight600 > 0))
               {
                WindowsInnerHeight = DefaultInnerWindowHeight600;
               };
             if ((ScreenResHeight > 767) && (ScreenResHeight <= 1023) && (DefaultInnerWindowHeight768 > 0))
               {
                WindowsInnerHeight = DefaultInnerWindowHeight768;
               };
             if ((ScreenResHeight > 1023) && (DefaultInnerWindowHeight1024 > 0))
               {
                WindowsInnerHeight = DefaultInnerWindowHeight1024;
               };
            };
          };
     };
  };
     if (!window.MarginSizeRange1) {MarginSizeRange1 = 25;};
     if (!window.MarginSizeRange2) {MarginSizeRange2 = 40;};
     if (!window.MarginSizeRange3) {MarginSizeRange3 = 60;};
     if (!window.MarginSizeRange4) {MarginSizeRange4 = 70;};
     if (!window.MarginSizeRange5) {MarginSizeRange5 = 85;};
     if (!window.MarginSizeRange6) {MarginSizeRange6 = 100;};
     if (!window.MarginSizeRange7) {MarginSizeRange7 = 115;};



    // Calculate the appropriate margin size based on the WindowsInnerWidth.
    //
    // Note that on IE4+, WindowsInnerWidth is not known until AFTER the body tag
    if ((WindowsInnerWidth > 0) && (WindowsInnerWidth < 575))
      {
       MarginSize = MarginSizeRange1;
      }; 
    if ((WindowsInnerWidth >= 575) && (WindowsInnerWidth < 700))
      { 
       MarginSize = MarginSizeRange2;
      };
    if ((WindowsInnerWidth >= 700) && (WindowsInnerWidth < 750))
      {
       MarginSize = MarginSizeRange3;
      };
    if ((WindowsInnerWidth >= 750) && (WindowsInnerWidth < 875))
      {
       MarginSize = MarginSizeRange4;
      };
    if ((WindowsInnerWidth >= 875) && (WindowsInnerWidth < 950))
      {
       MarginSize = MarginSizeRange5;
      };
    if ((WindowsInnerWidth >= 950) && (WindowsInnerWidth < 1075))
      {
       MarginSize = MarginSizeRange6;
      };
    if (WindowsInnerWidth >= 1075)
      {
       MarginSize = MarginSizeRange7;
      };
    if (Netscape4Only)
      {
       MarginSize = MarginRangeNetscape4Only;
      };

 // Code functions related to the vertical scroll bar movement, size and positioning.
  // Code to return the current vertical scroll bar position. The value will be zero if it
  // is at the top or if the vertical scroll bar is not enabled or if the calculation is
  // invalid.
  // A typical JavaScript call is: 
  // VScrollBarPos = GetVerticalScrollBarPos();
  function GetVerticalScrollBarPos() {

    TheScrolledPagePositionOffset = 0;
    if (Version4Plus)
      {
       if (IEVersion >= 4)
         {
          TheScrolledPagePositionOffset = parseInt(document.body.scrollTop);          
         };
       if (NetscapeVersion >= 4)
         {
          TheScrolledPagePositionOffset = parseInt(window.pageYOffset);
         };
       if (isNaN(TheScrolledPagePositionOffset))
         {
          TheScrolledPagePositionOffset = 0;
         };
      };
    return parseInt(TheScrolledPagePositionOffset);
  };










// END CODE FOR STAND ALONE ONLY (niscode.js replacements)






 

  // LAYER FUNCTIONS
  //
  // Note that just about all of the layer positioning, sizing and moving functions require
  // that position: absolute; or position: relative be set. I use position: absolute as
  // otherwise things like a center tag will completely throw off everything.
  // Also a Doctype declaration must be made at the top of the page for these to all work.
  // Netscape 4 layers work fine overtop of other content along with movement, sizing,
  // visibility changes, etc. However the content must be hard coded in the layer as external
  // Iframe content is not supported under Netscape 4.

  // Code to dynamically write the Dynamic Layer style string. This is ONLY required if the
  // user is running Netscape4Only. It is also important that this be written at the bottom of
  // the page after all of the page content has been rendered as it causes problems under
  // IE5 running on the Mac. So it possible that there are other systems that are also
  // affected.  Keeping this at the bottom of the page solves those potential problems.
  //
  function WriteDynamicLayerStyleStringForNetscape4Only(TheDynamicLayerName,LayerAbsLeftPosition,LayerAbsTopPosition,TheLyrWidth,TheLyrHeight) {

    // This string is only required to be written under Netscape4Only (and not under
    // Netscape 4.0x browsers which are flakey). This step is not required for all other 
    // browsers. It starts out invisible, so after everything is defined call ShowLayer();
    if ((Netscape4Only) && (!FlakeyBrowser))
      {
       if (DynamicPromoLayerShow)
         {
          DynamicLayerStyleString = '<st' + 'yle ty' + 'pe="te' + 'xt\/c' + 'ss">';  
          DynamicLayerStyleString = DynamicLayerStyleString + '<' + '!-' + '- ';
          DynamicLayerStyleString = DynamicLayerStyleString + '#' + TheDynamicLayerName + ' {' + 'position: absolute; left: ' + LayerAbsLeftPosition + '; top: ' + LayerAbsTopPosition + '; width: ' + TheLyrWidth + '; height: ' + TheLyrHeight + '; ' + ';visibility: hide;}';
          DynamicLayerStyleString = DynamicLayerStyleString + ' -' + '-' + '>';
          DynamicLayerStyleString = DynamicLayerStyleString + '<' + '\/st' + 'yle' + '>';
          document.write(DynamicLayerStyleString);
         };
      };
  };

  function GetLayerWidth(TheLayerObj) {

    TheLayerWidth = 0; // Default value before testing below.
    if (Version4Plus)
      {
       if ((IEVersion >= 5) || (NetscapeVersion >= 6))
         {
          TheLayerWidth = parseInt(document.getElementById(TheLayerObj).style.width);
         };
       if ((IEVersion >= 4) && (IEVersion < 5))
         {
          TheLayerWidth = parseInt(document.all[TheLayerObj].style.width);
          // This code (including parseInt) replaces the depreciated pixelWidth value.
         };
       if ((Netscape4Only) && (!FlakeyBrowser))
         {
          TheLayerWidth = parseInt(document.layers[TheLayerObj].clip.width);
         };
      };
    return TheLayerWidth;
  };

  function SetLayerWidth(TheLayerObj,TheLayersNewWidth) {

    // The layer style must include "overflow: hidden;" for this to work properly.
    // When this is set, then if the width is set too wide then it will be ignored,
    // however, when it is set smaller it will crop the layer accordingly.
    if (Version4Plus)
      {
       if ((IEVersion >= 5) || (NetscapeVersion >= 6))
         {
          this.obj = document.getElementById(TheLayerObj).style;
          this.obj.width = parseInt(TheLayersNewWidth) + "px";
         };
       if ((IEVersion >= 4) && (IEVersion < 5))
         {
         this.obj = document.all[TheLayerObj].style;
         this.obj.width = parseInt(TheLayersNewWidth);
         // This code (including parseInt) replaces the depreciated pixelWidth value.
         };
       if ((Netscape4Only) && (!FlakeyBrowser))
         {
          this.obj = document.layers[TheLayerObj].clip;
          this.obj.width = parseInt(TheLayersNewWidth);
         };
      };
  };

  function GetLayerHeight(TheLayerObj) {

    TheLayerHeight = 0; // Default value before testing below.
    if (Version4Plus)
      {
       if ((IEVersion >= 5) || (NetscapeVersion >= 6))
         {
          TheLayerHeight = parseInt(document.getElementById(TheLayerObj).style.height);
         };
       if ((IEVersion >= 4) && (IEVersion < 5))
         {
          TheLayerHeight = parseInt(document.all[TheLayerObj].style.height);
          // This code (including parseInt) replaces the depreciated pixelHeight value.
         };
       if ((Netscape4Only) && (!FlakeyBrowser))
         {
          TheLayerHeight = parseInt(document.layers[TheLayerObj].clip.height);
         };
      };
    return TheLayerHeight;
  };

  function SetLayerHeight(TheLayerObj,TheLayersNewHeight) {

    // The layer style must include "overflow: hidden;" for this to work properly.
    // When this is set, then if the width is set too wide then it will be ignored,
    // however, when it is set smaller it will crop the layer accordingly.
    if (Version4Plus)
      {
       if ((IEVersion >= 5) || (NetscapeVersion >= 6))
         {
          this.obj = document.getElementById(TheLayerObj).style;
          this.obj.height = parseInt(TheLayersNewHeight) + "px";
         };
       if ((IEVersion >= 4) && (IEVersion < 5))
         {
         this.obj = document.all[TheLayerObj].style;
         this.obj.height = parseInt(TheLayersNewHeight);
         // This code (including parseInt) replaces the depreciated pixelHeight value.
         };
       if ((Netscape4Only) && (!FlakeyBrowser))
         {
          this.obj = document.layers[TheLayerObj].clip;
          this.obj.height = parseInt(TheLayersNewHeight);
         };
      };
  };

  function GetLayerLeftPos(TheLayerObj) {

    TheLayerLeftPos = 0; // Default value before testing below.
    if (Version4Plus)
      {
       if ((IEVersion >= 5) || (NetscapeVersion >= 6))
         {
          TheLayerLeftPos = parseInt(document.getElementById(TheLayerObj).style.left);
         };
       if ((IEVersion >= 4) && (IEVersion < 5))
         {
          TheLayerLeftPos = parseInt(document.all[TheLayerObj].style.left);
          // This code (including parseInt) replaces the depreciated pixelLeft value.
         };
       if ((Netscape4Only) && (!FlakeyBrowser))
         {
          TheLayerLeftPos = parseInt(document.layers[TheLayerObj].left);
         };
      };
    return TheLayerLeftPos;
  };

  function SetLayerLeftPos(TheLayerObj,TheLayersNewLeftPos) {

    if (Version4Plus)
      {
       if ((IEVersion >= 5) || (NetscapeVersion >= 6))
         {
          this.obj = document.getElementById(TheLayerObj).style;
          this.obj.left = parseInt(TheLayersNewLeftPos) + "px";
         };
       if ((IEVersion >= 4) && (IEVersion < 5))
         {
         this.obj = document.all[TheLayerObj].style;
         this.obj.left = parseInt(TheLayersNewLeftPos);
         // This code (including parseInt) replaces the depreciated pixelLeft value.
         };
      if ((Netscape4Only) && (!FlakeyBrowser))
         {
          this.obj = document.layers[TheLayerObj];
          this.obj.left = parseInt(TheLayersNewLeftPos);
         };
      };
  };

 function GetLayerTopPos(TheLayerObj) {

    TheLayerTopPos = 0; // Default value before testing below.
    if (Version4Plus)
      {
       if ((IEVersion >= 5) || (NetscapeVersion >= 6))
         {
          TheLayerTopPos = parseInt(document.getElementById(TheLayerObj).style.top);
         };
       if ((IEVersion >= 4) && (IEVersion < 5))
         {
          TheLayerTopPos = parseInt(document.all[TheLayerObj].style.top);
          // This code (including parseInt) replaces the depreciated pixelTop value.
         };
       if ((Netscape4Only) && (!FlakeyBrowser))
         {
          TheLayerTopPos = parseInt(document.layers[TheLayerObj].top);
         };
      };
    return TheLayerTopPos;
  };

  function SetLayerTopPos(TheLayerObj,TheLayersNewTopPos) {

    if (Version4Plus)
      {
       if ((IEVersion >= 5) || (NetscapeVersion >= 6))
         {
          this.obj = document.getElementById(TheLayerObj).style;
          this.obj.top = parseInt(TheLayersNewTopPos) + "px";
         };
       if ((IEVersion >= 4) && (IEVersion < 5))
         {
         this.obj = document.all[TheLayerObj].style;
         this.obj.top = parseInt(TheLayersNewTopPos);
         // This code (including parseInt) replaces the depreciated pixelTop value.
         };
      if ((Netscape4Only) && (!FlakeyBrowser))
        {
          this.obj = document.layers[TheLayerObj];
          this.obj.top = parseInt(TheLayersNewTopPos);
         };
      };
  };

  function GetLayerVisibility(TheLayerObj) {

    // Note: This is only useful if the visibility has previously been explicitly declared.
    // Possible returned values are "visible", "hidden", "collapse" and  "inherit" (where not
    // previously specified), although Netscape 4 may also return "show", "hide" and "inherit".
    // My own testing indicates that Netscape 4 seems to also accept being set to "visible"
    // and "hidden", so they may also be returned. An empty string may also be returned if the
    // browser is unsupported by this code.
    TheLayerVisibility = ""; // Default value before testing below.
    if (Version4Plus)
      {
       if ((IEVersion >= 5) || (NetscapeVersion >= 6))
         {
          TheLayerVisibility = document.getElementById(TheLayerObj).style.visibility;
         };
       if ((IEVersion >= 4) && (IEVersion < 5))
         {
          TheLayerVisibility = document.all[TheLayerObj].style.visibility;
         };
       if ((Netscape4Only) && (!FlakeyBrowser))
         {
          TheLayerVisibility = document.layers[TheLayerObj].visibility;
         };
      };
    return TheLayerVisibility;
  };

  function HideLayer(TheLayerObj) {

    if (Version4Plus)
      {
       if ((IEVersion >= 5) || (NetscapeVersion >= 6))
         {
          document.getElementById(TheLayerObj).style.visibility = "hidden";
         };
       if ((IEVersion >= 4) && (IEVersion < 5))
         {
          document.all[TheLayerObj].style.visibility = "hidden";
         };
       if ((Netscape4Only) && (!FlakeyBrowser))
         {
          document.layers[TheLayerObj].visibility = "hide";
         };
      };
  };

  function ShowLayer(TheLayerObj) {

    if (Version4Plus)
      {
       if ((IEVersion >= 5) || (NetscapeVersion >= 6))
         {
          document.getElementById(TheLayerObj).style.visibility = "visible";
         };
       if ((IEVersion >= 4) && (IEVersion < 5))
         {
          document.all[TheLayerObj].style.visibility = "visible";
         };
       if ((Netscape4Only) && (!FlakeyBrowser))
         {
          document.layers[TheLayerObj].visibility = "show";
         };
      };
  };











  function DynamicPromoLayerObject(id) {

    if (Version4Plus)
      {
       if (((IEVersion >= 4) || (NetscapeVersion >= 4)) && (!FlakeyBrowser))
         {
          SetLayerWidth (id, parseInt(DynamicPromoLayerWidth));
          SetLayerHeight (id, parseInt(DynamicPromoLayerHeight));
          SetLayerLeftPos (id, parseInt(DynamicPromoLayerLeftPos));
          VScrollBarPos = GetVerticalScrollBarPos(); // Get the current page scrolled offset.
          SetLayerTopPos (id, parseInt(DynamicPromoLayerTopPos) + parseInt(VScrollBarPos));
          DynamicPromoLayerStopPos = parseInt(DynamicPromoLayerStopPos) + parseInt(VScrollBarPos);
          ShowLayer(id);
          return this.obj;
         };
      };
  };
 

  function MoveThePromoLayer() {

    if (Version4Plus)
      {
       if (((IEVersion >= 4) || (NetscapeVersion >= 4)) && (!FlakeyBrowser))
         {
          CurrentWidth = GetLayerWidth("ContainerForDynamicPromoLayer");
          CurrentHeight = GetLayerHeight("ContainerForDynamicPromoLayer");
          CurrentLeftPos = GetLayerLeftPos("ContainerForDynamicPromoLayer");
          CurrentTopPos = GetLayerTopPos("ContainerForDynamicPromoLayer");
          SetLayerTopPos("ContainerForDynamicPromoLayer", (parseInt(CurrentTopPos) - 3));
          if (CurrentTopPos < DynamicPromoLayerStopPos)
            {
             window.clearInterval(DynamicPromoLayerInterval); // will stop it, if required.
            };
         };
      };
  };

  function DynamicPromoLayerSetup() {
 
    if (Version4Plus)
      {
       if (((IEVersion >= 4) || (NetscapeVersion >= 4)) && (!FlakeyBrowser))
         {
          this.obj = new DynamicPromoLayerObject('ContainerForDynamicPromoLayer');
          // Code to actually check the position and call the movement:
          DynamicPromoLayerInterval = window.setInterval("MoveThePromoLayer()",25);
          // Set for 25 milliseconds or 40 times a second.
          // NOTE: Settings faster than 25 have no appreciable effect and only tie up
          // the systems cpu.
          // window.clearInterval(DynamicPromoLayerInterval) will stop it, if required.
         };
      };
  };






  // THE ACTUAL CALLING CODE: 



  var DynamicPromoLayerShow = true;

var ShowDynamicPromoLayerOverrideIfExpiryDatePassed = true; // true or false
var ShowDynamicPromoLayerOverrideExpiryDate = 20100227;
// *** SET VALUE which should be an 8 digit number (not a string) that represents the date.
// I.E. Oct 6th, 2002 would be 20021006.


      if ((ShowDynamicPromoLayerOverrideIfExpiryDatePassed) && (ShowDynamicPromoLayerOverrideExpiryDate > 20020000))
        {
         if (IsTodaysDateGreaterThan(ShowDynamicPromoLayerOverrideExpiryDate))
           {
            // The dynamic promo layer expiry date override has been enabled and the date has
            // expired so turn off the dynamic promo layer.
            DynamicPromoLayerShow = false;
           }; 
        }; 

  // This variable should have been previously defined in the calling page.
  if (!(window.DynamicPromoLayerCallingPageIsAFlashPage))
    {
     DynamicPromoLayerCallingPageIsAFlashPage = false;
    };
  if (DynamicPromoLayerCallingPageIsAFlashPage)
    {
     // Do NOT show this code if it is called from a Flash based page and is not running
     // under IE 5.5+ on a Windows system.  If it is NOT a Flash based page that is calling it
     // then these restrictions don't apply.
     if (IEVersion < 5.5)
       {
        DynamicPromoLayerShow = false;
       };
     if (!IsWindows)
       {
        DynamicPromoLayerShow = false;
       };
    };

  var DynamicPromoLayerFileName = "promoadlayer.htm";
  var DynamicPromoLayerWidth = "280"; //// 351 for vette.swf, 440 for coupon
  var DynamicPromoLayerHeight = "178"; //"273"; // 270 for vette.swf, 200 for coupon 13 LARGER THAN IMG




  var DynamicPromoLayerTransparentOptionForWindowsIE5pt5Plus = true; // true or false;
// Allow for transparent flash promotions or other borderless transparent background effects.
// These are supported only in Windows under IE5.5+ browsers and will be overruled on
// other browsers.
// The calling IFrame must have a allowtransparency="true" parameter.
// Any Flash code must have an object parameter <param name="wmode" value="transparent" />
// and have no background image in the Flash sequence.
var TransparentIFrameOptionParameterString = "";
if (DynamicPromoLayerTransparentOptionForWindowsIE5pt5Plus)
  {
   if ((IsWindows) && (IEVersion >= 5.5))
     {
      TransparentIFrameOptionParameterString = 'allowtransparency=\"true\"';
     } else {
             DynamicPromoLayerTransparentOptionForWindowsIE5pt5Plus = false;
            };
  };


// NOTE: Transparent background results in flash on calling page covering up the static promo
// page on IE6 windows and (?) which doesn't happen if NOT transparent.
// HOWEVER IF TRANSPARENT MODE SET FOR BACKGROUND FLASH ON CALLING PAGE AS WELL THEN IT WORKS.
// TEST ON OLDER BROWSERS



  // Now dynamically position the starting position for the promo layer.
  var DynamicPromoLayerLeftPos = "400"; // Default value before being positioned below
  var DynamicPromoLayerTopPos = "150"; // Default value before being positioned below.
  var DynamicPromoLayerStopPos = "150"; // Default value before being positioned below.


  //
  var DynamicPromoLayerTimeDelayBeforeDisplay = 2000; // i.e. 3000 milliseconds = 3 second delay.


  var DynamicPromoLayerAutoCloseEnabled = true; // true or false
  var DynamicPromoLayerAutoCloseTimeDelay = 36000; // i.e. 23000 milliseconds = 23 second close.
  if ((DynamicPromoLayerAutoCloseEnabled) && (parseInt(DynamicPromoLayerAutoCloseTimeDelay) > 0))
    {
//     setTimeout('if(DynamicPromoLayerShow){HideLayer("ContainerForDynamicPromoLayer");};',parseInt(DynamicPromoLayerAutoCloseTimeDelay));


setTimeout('if(DynamicPromoLayerShow){AutoCloseTheWindowIfTimeExpired();};',parseInt(DynamicPromoLayerAutoCloseTimeDelay));




    };
    


  //
  if (Version4Plus)
    {
     GetPageWidthAndHeight();
     if (parseInt(pageHeight) > 0)
       {
        // The top is just below the bottom of the browsers visible viewport area.
        VScrollBarPos = GetVerticalScrollBarPos();
        DynamicPromoLayerTopPos = parseInt(pageHeight) + 10;
       };
     if (parseInt(pageWidth) > 0)
       {
        // The entire layer ends 25 pixels left of the right hand side of the browsers visible
        // viewport area.
        DynamicPromoLayerLeftPos = parseInt(pageWidth) - parseInt(DynamicPromoLayerWidth) - 15;
       };
     // Some corrections are required in positioning for Netscape4Only as the layer
     // is truncated depending on where the page margins are located.
     if ((Netscape4Only) && (!FlakeyBrowser))
       {
        DynamicPromoLayerLeftPos = parseInt(DynamicPromoLayerLeftPos) - parseInt(MarginSize);
       };
    };


if ((pageHeight > 0) && (DynamicPromoLayerHeight > 0))
  { 
   DynamicPromoLayerStopPos = parseInt(pageHeight) - parseInt(DynamicPromoLayerHeight) + 5;
  } else {
          DynamicPromoLayerStopPos = DynamicPromoLayerTopPos;
         };


// TEMP FOR NO MOVEMENT:
// DynamicPromoLayerLeftPos = "400";
// DynamicPromoLayerTopPos = "150";
// DynamicPromoLayerStopPos = "150";
// END TEMP







<!-- TEMP -->

function AutoCloseTheWindowIfTimeExpired() {
  
  // The HideLayer code is not used as due to the timeout the focus is actually on the 
  // iframe or Netscape4 layer code. So it's hard coded with the parent prefix.

    if (Version4Plus)
      {
       if ((IEVersion >= 5) || (NetscapeVersion >= 6))
         {
          parent.document.getElementById("ContainerForDynamicPromoLayer").style.visibility = "hidden";
         };
       if ((IEVersion >= 4) && (IEVersion < 5))
         {
          parent.document.all["ContainerForDynamicPromoLayer"].style.visibility = "hidden";
         };
       if ((Netscape4Only) && (!FlakeyBrowser))
         {
          parent.document.layers["ContainerForDynamicPromoLayer"].visibility = "hide";
         };
      };
};



var DynamicPromoIsAlreadyBeingLaunched = false;

function LaunchIfPageLoadDone() {

  if (DynamicPromoIsAlreadyBeingLaunched == false)
    {
     DynamicPromoIsAlreadyBeingLaunched = true;
     setTimeout('DynamicPromoLayerSetup();',DynamicPromoLayerTimeDelayBeforeDisplay);
    };
};

var PageIsNowLoadedAndReadyForPromoAdEffect = false;
function IsPageLoadDone () {

  if (PageIsNowLoadedAndReadyForPromoAdEffect == true)
    {
     // The page has finished loading.
     window.clearInterval(TestIfPageLoadDoneLoop);
     LaunchIfPageLoadDone();
    };
}; 

function CheckIfPageLoadDoneThenLaunch() {

  TestIfPageLoadDoneLoop = window.setInterval("IsPageLoadDone()",100);
  // Set for 100 milliseconds or 10 times a second.
  // window.clearInterval(TestIfPageLoadDoneLoop) will stop it, once required.


//  setTimeout('PageIsNowLoadedAndReadyForPromoAdEffect = true;',12000);


  // Backup code to start the effect in case the calling page is not set up properly or is
  // not correctly changing the PageIsNowLoadedAndReadyForPromoAdEffect variable on onload.  
};
<!-- END TEMP -->


function TriggerThePromoLayer() {

  // The following MUST NOT be in a CENTER tag as it messes up the absolute positioning:
  if (Version4Plus)
    {
     if (((IEVersion >= 4) || (NetscapeVersion >= 4)) && (!FlakeyBrowser))
       {
        if ((Netscape4Only) && (DynamicPromoLayerShow))
          {
           // Now actually write the Dynamic Layer style string. The function call will only
           // write it if the browser is Netscape4Only. This must be written at the bottom of
           // the page AFTER all other page content has been displayed to avoid problems on
           // some browsers such as IE5 on a Mac, etc.  Dynamically writing a style string in
           // the middle of the page may disrupt the layout on the rest of the page that
           // follows it on some other browsers as well.
           WriteDynamicLayerStyleStringForNetscape4Only("ContainerForDynamicPromoLayer","DynamicPromoLayerLeftPos","DynamicPromoLayerTopPos","DynamicPromoLayerWidth","DynamicPromoLayerHeight");
          };
        if (DynamicPromoLayerShow)
          {
           // The following line must be written for all other browsers AND Netscape4Only browsers.
           // Note: for Netscape4Only "layer" must be used NOT ilayer so that the properties may be
           // properly accessed and changed.
           document.write('<div id="ContainerForDynamicPromoLayer" name="ContainerForDynamicPromoLayer" style="position: absolute; overflow: hidden; border-style: none; visibility: hidden; z-index: 200; width: ' + DynamicPromoLayerWidth + 'px; height: ' + DynamicPromoLayerHeight + 'px; left: ' + DynamicPromoLayerLeftPos + 'px; top: ' + DynamicPromoLayerTopPos + 'px; "><iframe name="DynamicPromoLayer" id="DynamicPromoLayer" src="' + DynamicPromoLayerFileName + '" width="' + DynamicPromoLayerWidth + '" height="' + DynamicPromoLayerHeight + '" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" ' + TransparentIFrameOptionParameterString + ' style="left: -1px; top: -1px;"><layer src="' + DynamicPromoLayerFileName + '" id="Netscape4PromoLayer" name="Netscape4PromoLayer" width="' + DynamicPromoLayerWidth + '" height="' + DynamicPromoLayerHeight + '"><\/layer><\/iframe><\/div>');
           CheckIfPageLoadDoneThenLaunch();
          };
       };
    };
};



//  This code is triggered by the following code which is located on the bottom of the
//  calling page. Also note the required onload code changes that are shown below. 
//
//<!-- Dynamic Promo Layer Code -->
//<!-- As this following promo code uses a dynamic style string that is written for -->
//<!-- Netscape4Only browsers, it should be located AFTER all of the code on the page has -->
//<!-- been written. This avoids rendering problems such as IE5 under Mac and possibly other -->
//<!-- browsers that misrender any content that is shown after the dynamic style sheet write. -->
//<script language="JavaScript" type="text/javascript">
//<!-- Begin
//  
//  // This is the code that triggers the promo layer code. It is only activated once
//  // the page has finished loading as the body tag must contain the following code:
//  // onload="if(Version4Plus){PageIsNowLoadedAndReadyForPromoAdEffect=true;};"
//
//  // Now make sure that the following variables are globally declared BEFORE the
//  // external JavaScript file is loaded.
//
//  // This variable is required by the code that launches the promo ad layer.
//  // This is the default value that will be reset by the body onload code, which is
//  // changed in the PageLoadedExtraFunctions function code.
//  PageIsNowLoadedAndReadyForPromoAdEffect = false; // true or false.
//
//  // Now indicate whether or not this page contains a flash sequence (not including the
//  // promo ad layer). This is required as the browsers that work properly when a Flash
//  // or image layer is positioned overtop of an existing Flash sequence are a subset
//  // of the ones that work well when there is no Flash animation on the calling page.
//  var DynamicPromoLayerCallingPageIsAFlashPage = false; // true or false. 
//
//// End -->
//</script>
//<script language="JavaScript" src="promoadlayerstandalone.js" type="text/javascript"></script>
//<script language="JavaScript" type="text/javascript">
//<!-- Begin
//
//  if (Version4Plus)
//    {
//     // Now call the promo ad layer. Testing under Netscape 4 indicates that this code 
//     // may NOT be combined at the bottom of the external JavaScript file. Calling this
//     // function does not start the code, it only triggers a watch for when the page has
//     // completed loaded (when PageIsNowLoadedAndReadyForPromoAdEffect becomes true). 
//     TriggerThePromoLayer();
//    };
//
//// End -->
//</script>
