home *** CD-ROM | disk | FTP | other *** search
/ Magazyn WWW 2002 February / www_02_2002.iso / programy / babylon / babylon32.exe / babylon.chm / bsscdhtm.js < prev    next >
Text File  |  2001-04-18  |  64KB  |  2,023 lines

  1. //////////BSSCDHTML Section 1//////////
  2. // RoboHELP« Dynamic HTML Effects Script
  3. // Copyright ⌐ 1998-1999 Blue Sky Software Corporation.  All rights reserved.
  4.  
  5. // Version=3.56
  6.  
  7. // Warning:  Do not modify this file.  It is generated by RoboHELP« and changes will be overwritten.
  8.  
  9. //{{HH_SYMBOL_SECTION
  10. var HH_ChmFilename = "D:\\Program Files\\RoboHELP Office\\Babylon Client\\Babylon Client.chm";
  11. var HH_WindowName = "NewWindow";
  12. var HH_GlossaryFont = "";
  13. var HH_Glossary = "0";
  14. var HH_Avenue = "0";
  15. var HH_ActiveX = true;
  16. //}}HH_SYMBOL_SECTION
  17.  
  18. var gbNav4 = false;
  19. var gbIE4 = false;
  20. var gbIE = false;
  21. var gbIE5 = false;
  22. var gAgent = navigator.userAgent.toLowerCase(); 
  23. var gbMac = (gAgent.indexOf("mac") != -1);
  24. var gbWindows = ((gAgent.indexOf("win") != -1) || (gAgent.indexOf("16bit") != -1));
  25.  
  26. var error_count = 0;
  27.  
  28. gbIE = (navigator.appName.indexOf("Microsoft") != -1);
  29. if (parseInt(navigator.appVersion) >= 4) {
  30.     gbNav4 = (navigator.appName == "Netscape");
  31.     gbIE4 = (navigator.appName.indexOf("Microsoft") != -1);
  32.  
  33.     if (gbIE4) {
  34.         if (gAgent.indexOf("msie 5.0") != -1) {
  35.             gbIE5 = true;
  36.         }
  37.     }
  38. }
  39.  
  40. function HHActivateComponents()
  41. {
  42.     if (HH_ActiveX && (HH_ChmFilename != "") && ((self == top) || (self == top.frames[0])))
  43.     {
  44.         var objBody = document.all.tags("BODY")[0];
  45.         objBody.insertAdjacentHTML("beforeEnd", '<OBJECT ID="HHComponentActivator" CLASSID="CLSID:399CB6C4-7312-11D2-B4D9-00105A0422DF" width=0 height=0></OBJECT>');
  46.         if (HHComponentActivator.object)
  47.         {
  48.             HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue);
  49.         }
  50.     }
  51. }
  52.  
  53. var gAmc = new Array();
  54. var BSSCSequenceIndex = 0;
  55.  
  56. function animationContext(el, progressAnimation, finishAnimiation, animationDuration, animationPeriod)
  57. {
  58.     this.el = el;
  59.     this.progressAnimation = progressAnimation;
  60.     this.finishAnimiation = finishAnimiation;
  61.     this.animationDuration = parseFloat(animationDuration);
  62.     this.animationPeriod = animationPeriod;
  63.     this.animationStartTime = (new Date()).getTime();
  64.     this.continueAnimation = true;
  65. }
  66.  
  67. function progressFade(ndx)
  68. {
  69.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  70.     if (percent > 1.0){
  71.         percent = 1.0;
  72.         gAmc[ndx].continueAnimation = false;
  73.     }
  74.     gAmc[ndx].el.filters.alpha.opacity = gAmc[ndx].initialOpacity*(1.0-percent) +  gAmc[ndx].finalOpacity*percent;
  75. }
  76.  
  77. function finishFade(ndx)
  78. {
  79.     gAmc[ndx].el.filters.alpha.opacity = parseInt(gAmc[ndx].finalOpacity);
  80. }
  81.  
  82. function progressTranslation(ndx)
  83. {
  84.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  85.     if (percent > 1.0)    {
  86.         percent = 1.0;
  87.         gAmc[ndx].continueAnimation = false;
  88.     }
  89.     gAmc[ndx].el.style.pixelLeft = gAmc[ndx].startX*(1.0-percent) +  gAmc[ndx].finalX*percent;
  90.     gAmc[ndx].el.style.pixelTop = gAmc[ndx].startY*(1.0-percent) +  gAmc[ndx].finalY*percent;
  91. }
  92. function progressSpiral(ndx)
  93. {
  94.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  95.     if (percent > 1.0)    {
  96.         percent = 1.0;
  97.         gAmc[ndx].continueAnimation = false;
  98.     }
  99.     rf = 1.0 - percent
  100.     t = percent * 2.0*Math.PI
  101.     rx = Math.max(Math.abs(gAmc[ndx].el.initLeft), 200)
  102.     ry = Math.max(Math.abs(gAmc[ndx].el.initTop),  200)
  103.     gAmc[ndx].el.style.pixelLeft = Math.ceil(-rf*Math.cos(t)*rx)
  104.     gAmc[ndx].el.style.pixelTop  = Math.ceil(-rf*Math.sin(t)*ry)
  105.     gAmc[ndx].el.style.visibility="visible"    
  106. }
  107.  
  108. function progressElasticFromRight(ndx)
  109. {
  110.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  111.     if (percent > 1.0)    {
  112.         percent = 1.0;
  113.         gAmc[ndx].continueAnimation = false;
  114.     }
  115.     rf=Math.exp(-percent*7)
  116.     t = percent * 1.5*Math.PI
  117.     rx =Math.abs(gAmc[ndx].el.initLeft)
  118.     gAmc[ndx].el.style.pixelLeft = rf*Math.cos(t)*rx
  119.     gAmc[ndx].el.style.pixelTop = 0
  120.     gAmc[ndx].el.style.visibility="visible"    
  121. }
  122. function progressElasticFromBottom(ndx)
  123. {
  124.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  125.     if (percent > 1.0)    {
  126.         percent = 1.0;
  127.         gAmc[ndx].continueAnimation = false;
  128.     }
  129.     rf=Math.exp(-percent*7)
  130.     t = percent * 1.5*Math.PI
  131.     rx =Math.abs(gAmc[ndx].el.initTop)
  132.     gAmc[ndx].el.style.pixelLeft = 0
  133.     gAmc[ndx].el.style.pixelTop = rf*Math.cos(t)*rx
  134.     gAmc[ndx].el.style.visibility="visible"    
  135. }
  136.  
  137. function progressZoomIn(ndx)
  138. {
  139.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  140.     if (percent > 1.0)    {
  141.         percent = 1;
  142.         gAmc[ndx].continueAnimation = false;
  143.     }
  144.     for (var index=0; index<gAmc[ndx].el.all.length; index++) {
  145.         gAmc[ndx].el.all[index].style.fontSize = Math.ceil(50+50*percent) + "%"
  146.     }
  147.     gAmc[ndx].el.posLeft = 100
  148.     gAmc[ndx].el.style.visibility="visible"
  149.  
  150.     if (percent >= 1.0)    {
  151.         finishZoom(ndx);
  152.     }
  153. }
  154.  
  155. function progressZoomOut(ndx)
  156. {
  157.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  158.     if (percent > 1.0)    {
  159.         percent = 1.0;
  160.         gAmc[ndx].continueAnimation = false;
  161.     }
  162.  
  163.     for (var index=0; index<gAmc[ndx].el.all.length; index++)
  164.         gAmc[ndx].el.all[index].style.fontSize = Math.ceil(100+200*(1-percent)) + "%"
  165.     gAmc[ndx].el.posLeft = 0
  166.     gAmc[ndx].el.style.visibility="visible"
  167.  
  168.     if (percent >= 1.0)    {
  169.         finishZoom(ndx);
  170.     }
  171. }
  172. function finishTranslation(ndx)
  173. {
  174.     gAmc[ndx].el.style.pixelLeft = parseInt(gAmc[ndx].finalX);
  175.     gAmc[ndx].el.style.pixelTop = parseInt(gAmc[ndx].finalY);
  176. }
  177. function finishZoom(ndx)
  178. {
  179.     for (i=0; i<gAmc[ndx].el.all.length; i++)
  180.         gAmc[ndx].el.all[i].style.fontSize = gAmc[ndx].OldFont
  181.  
  182.  
  183. function animationPump(ndx)
  184. {
  185.     gAmc[ndx].progressAnimation(ndx);
  186.     if (gAmc[ndx].continueAnimation)
  187.         gAmc[ndx].tm = setTimeout("animationPump(" + ndx + ");", gAmc[ndx].animationPeriod);
  188. }
  189.  
  190. function clearAnimations()
  191. {
  192.     for (var index=0; index<gAmc.length; index++) {
  193.         gAmc[index].finishAnimiation(index);
  194.         clearTimeout(gAmc[index].tm);
  195.     }
  196.     gAmc = new Array();
  197. }
  198.  
  199. function startNextAnimationSet()
  200. {
  201.     clearAnimations();
  202.     bStarted = false;
  203.     bFound = false
  204.  
  205.     // Determine the next sequence number
  206.     divElements = document.all.tags("DIV");
  207.     for (var index = 0; index < divElements.length; index++) 
  208.     {
  209.         el = divElements[index];
  210.         objectOrder = el.getAttribute("BSSCObjectOrder", false);
  211.         if(null != objectOrder)
  212.         {
  213.             objectOrder = parseInt(objectOrder);
  214.             if (objectOrder > BSSCSequenceIndex && (!bFound || objectOrder < minBSSCSequenceIndexFound))
  215.             {
  216.                 minBSSCSequenceIndexFound = objectOrder;
  217.                 bFound = true;
  218.             }
  219.         }
  220.     }
  221.  
  222.     if (bFound)
  223.     {
  224.         BSSCSequenceIndex = minBSSCSequenceIndexFound;
  225.         bStarted = startAnimationSet(BSSCSequenceIndex);
  226.     }
  227. }
  228.  
  229. function getOffsetFromTopOfBrowser(el)
  230. {
  231.     if (null == el.offsetParent)
  232.         return el.offsetTop;
  233.     else
  234.         return el.offsetTop + getOffsetFromTopOfBrowser(el.offsetParent);
  235. }
  236.  
  237. function startAnimationSet(ndx)
  238. {
  239.     var m = 0;
  240.     bStarted = false;
  241.  
  242.     // Find document elements with "BSSCAnimationType" attribute
  243.     divElements = document.all.tags("DIV");
  244.     for (var index = 0; index < divElements.length; index++)
  245.     {
  246.         el = divElements[index];
  247.         
  248.         animationType = el.getAttribute("BSSCAnimationType", false);
  249.         if(null != animationType)
  250.         {
  251.             framePeriod = el.getAttribute("BSSCFramePeriod", false);
  252.             frameCount = el.getAttribute("BSSCFrameCount", false);
  253.             sequenceIndex = el.getAttribute("BSSCObjectOrder", false);
  254.  
  255.             // Stop any currently running RevealTrans filters
  256.             if ("RevealTrans" == animationType && parseInt(sequenceIndex) == ndx-1 && gbWindows)
  257.                 el.filters.RevealTrans.stop();  
  258.             // Filter on ndx
  259.             if (0 == ndx && null == sequenceIndex ||
  260.                 ndx == parseInt(sequenceIndex))
  261.             {
  262.                 if ("FlyInFromRight" == animationType)
  263.                 {
  264.                     animationDuration = el.getAttribute("BSSCDuration", false);
  265.                     if (null == animationDuration)
  266.                         animationDuration = 1000; // default to 1s
  267.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  268.                     gAmc[m].startX = document.body.clientWidth + document.body.scrollLeft;
  269.                     gAmc[m].startY = 0;
  270.                     gAmc[m].finalX = 0;
  271.                     gAmc[m].finalY = 0;
  272.                     animationPump(m++);
  273.                     bStarted = true;
  274.                 }
  275.                 if ("FlyOutToRight" == animationType)
  276.                 {
  277.                     animationDuration = el.getAttribute("BSSCDuration", false);
  278.                     if (null == animationDuration)
  279.                         animationDuration = 1000; // default to 1s
  280.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  281.                     gAmc[m].startX = 0;
  282.                     gAmc[m].startY = 0;
  283.                     gAmc[m].finalX = document.body.clientWidth + document.body.scrollWidth;
  284.                     gAmc[m].finalY = 0;
  285.                     animationPump(m++);
  286.                     bStarted = true;
  287.                 }
  288.                 if ("FlyInFromLeft" == animationType)
  289.                 {
  290.                     animationDuration = el.getAttribute("BSSCDuration", false);
  291.                     if (null == animationDuration)
  292.                         animationDuration = 1000; // default to 1s
  293.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  294.                     {
  295.                         if ("left" == el.children[childIndex].style.textAlign)
  296.                             el.children[childIndex].style.textAlign = "right";
  297.                     }
  298.                     pixelsToTranslate = document.body.clientWidth;
  299.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  300.                     gAmc[m].startX = -(document.body.clientWidth + document.body.scrollLeft);
  301.                     gAmc[m].startY = 0;
  302.                     gAmc[m].finalX = 0;
  303.                     gAmc[m].finalY = 0;
  304.                     animationPump(m++);
  305.                     bStarted = true;
  306.                 }
  307.                 if ("FlyOutToLeft" == animationType)
  308.                 {
  309.                     animationDuration = el.getAttribute("BSSCDuration", false);
  310.                     if (null == animationDuration)
  311.                         animationDuration = 1000; // default to 1s
  312.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  313.                     {
  314.                         if ("left" == el.children[childIndex].style.textAlign)
  315.                             el.children[childIndex].style.textAlign = "right";
  316.                     }
  317.                     pixelsToTranslate = document.body.clientWidth;
  318.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  319.                     gAmc[m].startX = 0;
  320.                     gAmc[m].startY = 0;
  321.                     gAmc[m].finalX = -(document.body.clientWidth + document.body.scrollWidth);
  322.                     gAmc[m].finalY = 0;
  323.                     animationPump(m++);
  324.                     bStarted = true;
  325.                 }
  326.                 if ("FlyInFromBottom" == animationType)
  327.                 {
  328.                     animationDuration = el.getAttribute("BSSCDuration", false);
  329.                     if (null == animationDuration)
  330.                         animationDuration = 1000; // default to 1s
  331.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  332.                     gAmc[m].startX = 0;
  333.                     gAmc[m].startY = document.body.clientHeight + document.body.scrollTop;
  334.                     gAmc[m].finalX = 0;
  335.                     gAmc[m].finalY = 0;
  336.                     animationPump(m++);
  337.                     bStarted = true;
  338.                 }
  339.                 if ("FlyOutToBottom" == animationType)
  340.                 {
  341.                     animationDuration = el.getAttribute("BSSCDuration", false);
  342.                     if (null == animationDuration)
  343.                         animationDuration = 1000; // default to 1s
  344.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  345.                     gAmc[m].startX = 0;
  346.                     gAmc[m].startY = 0;
  347.                     gAmc[m].finalX = 0;
  348.                     gAmc[m].finalY = document.body.clientHeight + document.body.scrollHeight;
  349.                     animationPump(m++);
  350.                     bStarted = true;
  351.                 }
  352.                 if ("FlyInFromTop" == animationType)
  353.                 {
  354.                     animationDuration = el.getAttribute("BSSCDuration", false);
  355.                     if (null == animationDuration)
  356.                         animationDuration = 1000; // default to 1s
  357.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  358.                     gAmc[m].startX = 0;
  359.                     gAmc[m].startY = -getOffsetFromTopOfBrowser(el) - el.offsetHeight;
  360.                     gAmc[m].finalX = 0;
  361.                     gAmc[m].finalY = 0;
  362.                     animationPump(m++);
  363.                     bStarted = true;
  364.                 }
  365.                 if ("FlyOutToTop" == animationType)
  366.                 {
  367.                     animationDuration = el.getAttribute("BSSCDuration", false);
  368.                     if (null == animationDuration)
  369.                         animationDuration = 1000; // default to 1s
  370.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  371.                     gAmc[m].startX = 0;
  372.                     gAmc[m].startY = 0;
  373.                     gAmc[m].finalX = 0;
  374.                     gAmc[m].finalY = -getOffsetFromTopOfBrowser(el) - el.offsetHeight;
  375.                     animationPump(m++);
  376.                     bStarted = true;
  377.                 }
  378.                 if ("FlyInFromBottomRight" == animationType)
  379.                 {
  380.                     animationDuration = el.getAttribute("BSSCDuration", false);
  381.                     if (null == animationDuration)
  382.                         animationDuration = 1000; // default to 1s
  383.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  384.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  385.                         pixelsToTranslate = document.body.clientHeight + document.body.scrollTop - el.offsetTop;
  386.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  387.                     gAmc[m].startX = pixelsToTranslate;
  388.                     gAmc[m].startY = pixelsToTranslate;
  389.                     gAmc[m].finalX = 0;
  390.                     gAmc[m].finalY = 0;
  391.                     animationPump(m++);
  392.                     bStarted = true;
  393.                 }
  394.                 if ("FlyOutToBottomRight" == animationType)
  395.                 {
  396.                     animationDuration = el.getAttribute("BSSCDuration", false);
  397.                     if (null == animationDuration)
  398.                         animationDuration = 1000; // default to 1s
  399.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  400.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  401.                         pixelsToTranslate = document.body.clientHeight +document.body.scrollTop - el.offsetTop;
  402.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  403.                     gAmc[m].startX = 0;
  404.                     gAmc[m].startY = 0;
  405.                     gAmc[m].finalX = pixelsToTranslate;
  406.                     gAmc[m].finalY = pixelsToTranslate;
  407.                     animationPump(m++);
  408.                     bStarted = true;
  409.                 }
  410.                 if ("FlyInFromTopRight" == animationType)
  411.                 {
  412.                     animationDuration = el.getAttribute("BSSCDuration", false);
  413.                     if (null == animationDuration)
  414.                         animationDuration = 1000; // default to 1s
  415.                     pixelsToTranslate = document.body.clientWidth;
  416.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  417.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  418.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  419.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  420.                     gAmc[m].startX = pixelsToTranslate;
  421.                     gAmc[m].startY = -pixelsToTranslate;
  422.                     gAmc[m].finalX = 0;
  423.                     gAmc[m].finalY = 0;
  424.                     animationPump(m++);
  425.                     bStarted = true;
  426.                 }
  427.                 if ("FlyOutToTopRight" == animationType)
  428.                 {
  429.                     animationDuration = el.getAttribute("BSSCDuration", false);
  430.                     if (null == animationDuration)
  431.                         animationDuration = 1000; // default to 1s
  432.                     pixelsToTranslate = document.body.clientWidth;
  433.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  434.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  435.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  436.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  437.                     gAmc[m].startX = 0;
  438.                     gAmc[m].startY = 0;
  439.                     gAmc[m].finalX = pixelsToTranslate;
  440.                     gAmc[m].finalY = -pixelsToTranslate;
  441.                     animationPump(m++);
  442.                     bStarted = true;
  443.                 }
  444.                 if ("FlyInFromTopLeft" == animationType)
  445.                 {
  446.                     animationDuration = el.getAttribute("BSSCDuration", false);
  447.                     if (null == animationDuration)
  448.                         animationDuration = 1000; // default to 1s
  449.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  450.                     {
  451.                         if ("left" == el.children[childIndex].style.textAlign)
  452.                             el.children[childIndex].style.textAlign = "right";
  453.                     }
  454.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  455.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  456.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  457.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  458.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  459.                     gAmc[m].startX = -pixelsToTranslate;
  460.                     gAmc[m].startY = -pixelsToTranslate;
  461.                     gAmc[m].finalX = 0;
  462.                     gAmc[m].finalY = 0;
  463.                     animationPump(m++);
  464.                     bStarted = true;
  465.                 }
  466.                 if ("FlyOutToTopLeft" == animationType)
  467.                 {
  468.                     animationDuration = el.getAttribute("BSSCDuration", false);
  469.                     if (null == animationDuration)
  470.                         animationDuration = 1000; // default to 1s
  471.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  472.                     {
  473.                         if ("left" == el.children[childIndex].style.textAlign)
  474.                             el.children[childIndex].style.textAlign = "right";
  475.                     }
  476.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  477.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  478.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  479.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  480.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  481.                     gAmc[m].startX = 0;
  482.                     gAmc[m].startY = 0;
  483.                     gAmc[m].finalX = -pixelsToTranslate;
  484.                     gAmc[m].finalY = -pixelsToTranslate;
  485.                     animationPump(m++);
  486.                     bStarted = true;
  487.                 }
  488.                 if ("FlyInFromBottomLeft" == animationType)
  489.                 {
  490.                     animationDuration = el.getAttribute("BSSCDuration", false);
  491.                     if (null == animationDuration)
  492.                         animationDuration = 1000; // default to 1s
  493.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  494.                     {
  495.                         if ("left" == el.children[childIndex].style.textAlign)
  496.                             el.children[childIndex].style.textAlign = "right";
  497.                     }
  498.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  499.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  500.                         pixelsToTranslate = document.body.clientHeight + document.body.scrollTop - el.offsetTop;
  501.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  502.                     gAmc[m].startX = -pixelsToTranslate;
  503.                     gAmc[m].startY = pixelsToTranslate;
  504.                     gAmc[m].finalX = 0;
  505.                     gAmc[m].finalY = 0;
  506.                     animationPump(m++);
  507.                     bStarted = true;
  508.                 }
  509.                 if ("FlyOutToBottomLeft" == animationType)
  510.                 {
  511.                     animationDuration = el.getAttribute("BSSCDuration", false);
  512.                     if (null == animationDuration)
  513.                         animationDuration = 1000; // default to 1s
  514.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  515.                     {
  516.                         if ("left" == el.children[childIndex].style.textAlign)
  517.                             el.children[childIndex].style.textAlign = "right";
  518.                     }
  519.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  520.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  521.                         pixelsToTranslate = document.body.clientHeight +document.body.scrollTop - el.offsetTop;
  522.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  523.                     gAmc[m].startX = 0;
  524.                     gAmc[m].startY = 0;
  525.                     gAmc[m].finalX = -pixelsToTranslate;
  526.                     gAmc[m].finalY = pixelsToTranslate;
  527.                     animationPump(m++);
  528.                     bStarted = true;
  529.                 }
  530.                 if ("FadeIn" == animationType)
  531.                 {
  532.                     if (gbWindows)
  533.                     {
  534.                         animationDuration = el.getAttribute("BSSCDuration", false);
  535.                         if (null == animationDuration)
  536.                             animationDuration = 1000; // default to 1s
  537.                         finalOpacity = el.getAttribute("BSSCFinalOpacity", false);
  538.                         if (null == finalOpacity)
  539.                             finalOpacity = 100;
  540.                         initialOpacity = el.getAttribute("BSSCInitialOpacity", false);
  541.                         if (null == initialOpacity)
  542.                             initialOpacity = 0;
  543.                         gAmc[m] = new animationContext(el, progressFade, finishFade, animationDuration, 50);
  544.                         el.filters.opacity = initialOpacity;
  545.                         gAmc[m].initialOpacity = initialOpacity;
  546.                         gAmc[m].finalOpacity = finalOpacity;
  547.                         animationPump(m++);
  548.                         bStarted = true;
  549.                     } else {
  550.                         el.style.visibility = "";
  551.                     }
  552.                 }
  553.                 if ("Spiral" == animationType)
  554.                 {
  555.                     animationDuration = el.getAttribute("BSSCDuration", false);
  556.                     if (null == animationDuration)
  557.                         animationDuration = 1000; // default to 1s
  558.  
  559.                     gAmc[m] = new animationContext(el, progressSpiral, finishTranslation, animationDuration, 10);
  560.                     gAmc[m].el.initLeft = el.offsetLeft+document.body.clientWidth;
  561.                     gAmc[m].el.initTop = document.body.scrollTop+el.offsetTop+document.body.clientHeight;
  562.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  563.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  564.                     gAmc[m].finalX = 0;
  565.                     gAmc[m].finalY = 0;
  566.                     gAmc[m].steps = 0;
  567.                     animationPump(m++);
  568.                     bStarted = true;
  569.                 }
  570.                 if ("ElasticFromRight" == animationType)
  571.                 {
  572.                     animationDuration = el.getAttribute("BSSCDuration", false);
  573.                     if (null == animationDuration)
  574.                         animationDuration = 1000; // default to 1s
  575.                     gAmc[m] = new animationContext(el, progressElasticFromRight, finishTranslation, animationDuration, 10);
  576.                     gAmc[m].el.initLeft = el.offsetLeft+document.body.clientWidth;
  577.                     gAmc[m].el.initTop = gAmc[m].el.posTop;
  578.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  579.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  580.                     gAmc[m].finalX = 0;
  581.                     gAmc[m].finalY = 0;
  582.                     gAmc[m].steps = 0;
  583.                     animationPump(m++);
  584.                     bStarted = true;
  585.                 }
  586.                 if ("ElasticFromBottom" == animationType)
  587.                 {
  588.                     animationDuration = el.getAttribute("BSSCDuration", false);
  589.                     if (null == animationDuration)
  590.                         animationDuration = 1000; // default to 1s
  591.                     gAmc[m] = new animationContext(el, progressElasticFromBottom, finishTranslation, animationDuration, 10);
  592.                     gAmc[m].el.initLeft = gAmc[m].el.posLeft;
  593.                     gAmc[m].el.initTop = document.body.scrollTop-el.offsetTop-el.offsetHeight;
  594.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  595.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  596.                     gAmc[m].finalX = 0;
  597.                     gAmc[m].finalY = 0;
  598.                     gAmc[m].steps = 0;
  599.                     animationPump(m++);
  600.                     bStarted = true;
  601.                 }
  602.                 if ("ZoomIn" == animationType)
  603.                 {
  604.                     animationDuration = el.getAttribute("BSSCDuration", false);
  605.                     if (null == animationDuration)
  606.                         animationDuration = 1000; // default to 1s
  607.                     gAmc[m] = new animationContext(el, progressZoomIn, finishZoom, animationDuration, 10);
  608.                     gAmc[m].OldFont = gAmc[m].el.all[0].style.fontSize;
  609.                     animationPump(m++);
  610.                     bStarted = true;
  611.                 }
  612.                 if ("ZoomOut" == animationType)
  613.                 {
  614.                     animationDuration = el.getAttribute("BSSCDuration", false);
  615.                     if (null == animationDuration)
  616.                         animationDuration = 1000; // default to 1s
  617.                     gAmc[m] = new animationContext(el, progressZoomOut, finishZoom, animationDuration, 10);
  618.                     gAmc[m].OldFont = gAmc[m].el.all[0].style.fontSize;
  619.                     animationPump(m++);
  620.                     bStarted = true;
  621.                 }
  622.                 if ("RevealTrans" == animationType)
  623.                 {
  624.                     if (gbWindows) {
  625.                         Duration = el.getAttribute("BSSCDuration", false);
  626.                         if (null == Duration)
  627.                             Duration = 1000; // default to 1s
  628.                         Transition = el.getAttribute("BSSCTransition", false);
  629.                         if (null == Transition)
  630.                             Transition = 0;
  631.                         el.style.filter = "RevealTrans();";
  632.                         el.filters.RevealTrans.Transition = Transition;
  633.                         el.filters.RevealTrans.apply();
  634.                         el.style.visibility = ""; 
  635.                         el.filters.RevealTrans.play(parseInt(Duration)/1000.0);  
  636.                         bStarted = true;
  637.                     } else {
  638.                         el.style.visibility = "";
  639.                     }
  640.                 }
  641.             }
  642.         }
  643.     }
  644.     return bStarted;
  645. }
  646.  
  647. function ApplyTextFormatting(divEl, childEl)
  648. {
  649.     childEl.setAttribute("BSSCOriginalStyle", childEl.style);
  650.  
  651.     // Text Change
  652.     hoverColor = divEl.getAttribute("BSSCHoverColor", false);
  653.     if ("Default" != divEl.getAttribute("BSSCHoverColorName"))
  654.     {
  655.         childEl.setAttribute("BSSCOriginalColor", childEl.style.color);
  656.         childEl.style.color = hoverColor;
  657.     }
  658.     hoverFontName = divEl.getAttribute("BSSCHoverFontName", false);
  659.     if (null != hoverFontName && hoverFontName != "*Default*")
  660.     {
  661.         hoverFontFamily = divEl.getAttribute("BSSCHoverFontFamily", false);
  662.         if (null != hoverFontFamily)
  663.         {
  664.             childEl.setAttribute("BSSCOriginalFontFamily", childEl.style.fontFamily);
  665.             childEl.style.fontFamily = hoverFontFamily;
  666.         }
  667.     }
  668.     hoverFontSize = divEl.getAttribute("BSSCHoverFontSize", false);
  669.     {
  670.         if (null != hoverFontSize && hoverFontSize != "*")
  671.         {
  672.             childEl.setAttribute("BSSCOriginalFontSize", childEl.style.fontSize);
  673.             childEl.style.fontSize = hoverFontSize + "pt";
  674.         }
  675.     }
  676.     hoverFontStyle = divEl.getAttribute("BSSCHoverFontStyle", false);
  677.     if (null != hoverFontStyle && "Regular" != hoverFontStyle)
  678.     {
  679.         if ("Italic" == hoverFontStyle)
  680.         {
  681.             childEl.setAttribute("BSSCOriginalFontStyle", childEl.style.fontStyle);
  682.             childEl.style.fontStyle = "italic";
  683.         }
  684.         else if ("Bold" == hoverFontStyle)
  685.         {
  686.             childEl.setAttribute("BSSCOriginalFontWeight", childEl.style.fontWeight);
  687.             childEl.style.fontWeight = "bold";
  688.         }
  689.         else if ("Bold Italic" == hoverFontStyle)
  690.         {
  691.             childEl.setAttribute("BSSCOriginalFontStyle", childEl.style.fontStyle);
  692.             childEl.style.fontStyle = "italic";
  693.             childEl.setAttribute("BSSCOriginalFontWeight", childEl.style.fontWeight);
  694.             childEl.style.fontWeight = "bold";
  695.         }
  696.     }
  697.     hoverUnderline = divEl.getAttribute("BSSCHoverUnderLine", false);
  698.     if (null != hoverUnderline && hoverUnderline == "TRUE")
  699.     {
  700.         childEl.setAttribute("BSSCOriginalTextDecoration", childEl.style.textDecoration);
  701.         childEl.style.textDecoration = "underline";
  702.     }
  703. }
  704.  
  705. function RemoveTextFormatting(el)
  706. {
  707.     originalColor = el.getAttribute("BSSCOriginalColor", false);
  708.     if (null != originalColor)
  709.         el.style.color = originalColor;
  710.     originalFontFamily = el.getAttribute("BSSCOriginalFontFamily", false);
  711.     if (null != originalFontFamily)
  712.         el.style.fontFamily = originalFontFamily;
  713.     originalFontSize = el.getAttribute("BSSCOriginalFontSize", false);
  714.     if (null != originalFontSize)
  715.         el.style.fontSize = originalFontSize;
  716.     originalFontStyle = el.getAttribute("BSSCOriginalFontStyle", false);
  717.     if (null != originalFontStyle)
  718.         el.style.fontStyle = originalFontStyle;
  719.     originalFontWeight = el.getAttribute("BSSCOriginalFontWeight", false);
  720.     if (null != originalFontWeight)
  721.         el.style.fontWeight = originalFontWeight;
  722.     originalTextDecoration = el.getAttribute("BSSCOriginalTextDecoration", false);
  723.     if (null != originalTextDecoration)
  724.         el.style.textDecoration = originalTextDecoration;
  725. }
  726.  
  727. function BSSCOnMouseOver(el)
  728. {
  729.     // Text Formatting
  730.     hoverColor = el.getAttribute("BSSCHoverColor", false);
  731.     if (null != hoverColor)
  732.         for (var index=0; index<el.all.length; index++)
  733.             ApplyTextFormatting(el, el.all[index]);
  734.  
  735.     // Glow
  736.     glowColor = el.getAttribute("BSSCGlowColor", false);
  737.     if (null != glowColor)
  738.     {
  739.         glowStrength = el.getAttribute("BSSCGlowStrength", false);
  740.         if (null == glowStrength)
  741.             glowStrength = "3";
  742.         glowColorName = el.getAttribute("BSSCGlowColorName");
  743.         if ("Default" == glowColorName)
  744.             el.style.filter = "glow(Strength=" + glowStrength + ", enabled=1)";
  745.         else
  746.             el.style.filter = "glow(Color=#" + glowColor + ", Strength=" + glowStrength + ", enabled=1)";
  747.     }
  748. }
  749.  
  750. function BSSCOnMouseOut(el)
  751. {
  752.     // Text Formatting
  753.     hoverColor = el.getAttribute("BSSCHoverColor", false);
  754.     if (null != hoverColor)
  755.         for (var index=0; index<el.all.length; index++)
  756.             RemoveTextFormatting(el.all[index]);
  757.  
  758.     // Glow
  759.     glowColor = el.getAttribute("BSSCGlowColor", false);
  760.     if (null != glowColor)
  761.         el.style.filter="";
  762. }
  763.  
  764. function doStaticEffects()
  765. {
  766.     divElements = document.all.tags("DIV");
  767.     for (var index = 0; index < divElements.length; index++)
  768.     {
  769.         el = divElements[index];
  770.         
  771.         dropShadowColor = el.getAttribute("BSSCDropShadowColor");
  772.         if (null != dropShadowColor)
  773.         {
  774.             dropShadowXOffset = el.getAttribute("BSSCDropShadowXOffset");
  775.             if (null == dropShadowXOffset)
  776.                 dropShadowXOffset = 0;
  777.             dropShadowYOffset = el.getAttribute("BSSCDropShadowYOffset");
  778.             if (null == dropShadowYOffset)
  779.                 dropShadowYOffset = 0;
  780.             dropShadowColorName = el.getAttribute("BSSCDropShadowColorName");
  781.             if ("Default" == dropShadowColorName)
  782.                 el.style.filter = "DropShadow(OffX=" + dropShadowXOffset + ", OffY=" + dropShadowYOffset + ")";
  783.             else
  784.                 el.style.filter = "DropShadow(Color=" + dropShadowColor + ", OffX=" + dropShadowXOffset + ", OffY=" + dropShadowYOffset + ")";
  785.         }
  786.     }
  787. }
  788.  
  789. function drop( targetId )
  790.     target = document.all( targetId );
  791.     if (target.style.display == 'none') {
  792.        target.style.display = "" ;
  793.     } else {
  794.        target.style.display = "none";
  795.     }
  796.     event.cancelBubble = true;
  797. }
  798.  
  799. function checkParent(src,dest)
  800. {
  801.     //Search for a specific parent of the current element.
  802.     while(src !=null)
  803.     {
  804.         if(src.tagName == dest)
  805.         {
  806.             return src;
  807.         }
  808.         src = src.parentElement;
  809.     }
  810.     return null;
  811. }
  812.  
  813. //Generic Display code
  814. function outline2()
  815. {
  816.     //Expand or collapse if a list item is clicked.
  817.     var open = event.srcElement;
  818.  
  819.     //Verify that the tag which was clicked was either the 
  820.     //trigger tag or nested within a trigger tag.
  821.     var el = checkParent(open,"CITE");
  822.     if(null != el)
  823.     {    
  824.         var incr=0;
  825.         var elmPos = 0;
  826.         var parentSpan;
  827.         var fBreak
  828.  
  829.         //Get the position of the element which was clicked
  830.         elemPos = window.event.srcElement.sourceIndex;
  831.  
  832.         //Search for a SPAN tag
  833.         for (parentSpan = window.event.srcElement.parentElement; parentSpan!=null;    parentSpan = parentSpan.parentElement) 
  834.         {
  835.             //test if already at a span tag 
  836.             if (parentSpan.tagName=="SPAN") {
  837.                 incr=1;
  838.                 break;
  839.             }
  840.             
  841.             //Test if the tag clicked was in a body tag or in any of the possible kinds of lists
  842.             //we perform this test because nested lists require special handling
  843.             if (parentSpan.tagName=="BODY" || parentSpan.tagName=="UL" || parentSpan.tagName=="OL") 
  844.             {
  845.                 //Determine where the span to be expanded is.  
  846.                 for (incr=1; (elemPos+incr) < document.all.length; incr++)
  847.                 {    
  848.                     //verify we are at an expandable Div tag
  849.                     if(document.all(elemPos+incr).tagName=="SPAN" && (document.all(elemPos+incr).className=="expanded" || document.all(elemPos+incr).className=="glossexpanded" || document.all(elemPos+incr).className=="glosscollapsed" || document.all(elemPos+incr).className=="collapsed"))
  850.                     {
  851.                         fBreak=1;
  852.                         break;
  853.                     }
  854.                     else if(document.all(elemPos+incr).tagName=="LI")
  855.                     {
  856.                         //If the next tag following the list item (li) is another list item(li) return in order to prevent accidentally opening the next span in the list
  857.                         return;
  858.                     }
  859.                 }
  860.             }
  861.             //determine if we need to break out of the while loop (kind of a kludge since theres no goto in javascript)
  862.             if(fBreak==1)
  863.             {
  864.                 break;
  865.             }
  866.         }
  867.     }
  868.     else
  869.     {
  870.         return;
  871.     }
  872.  
  873.     //Now that we've identified the span, expand or collapse it
  874.     if(document.all(elemPos+incr) == null) {    
  875.         return;
  876.     } else if(document.all(elemPos+incr).className=="collapsed") {
  877.         document.all(elemPos+incr).className="expanded";
  878.     } else if(document.all(elemPos+incr).className=="expanded")  {
  879.         document.all(elemPos+incr).className="collapsed";
  880.     } else if(document.all(elemPos+incr).className=="glosscollapsed") {
  881.         document.all(elemPos+incr).className="glossexpanded";
  882.     } else if(document.all(elemPos+incr).className=="glossexpanded") {
  883.         document.all(elemPos+incr).className="glosscollapsed";
  884.     } else    {
  885.         return;
  886.     }
  887.     event.cancelBubble = true;
  888. }
  889.  
  890.  
  891. //////////BSSCDHTML Section 2//////////
  892.  
  893. function RemoveNavBar()
  894. {
  895.     // See if we are in a popup and if so remove the NavBar
  896.     if (BSSCPopup_IsPopup()) {
  897.  
  898.         if (gbIE4) {
  899.             var tempColl = document.all.tags("DIV");
  900.             for (var iDiv = 0; iDiv < tempColl.length; iDiv++) {
  901.                 if (tempColl(iDiv).id == "NavBar") {
  902.                     tempColl(iDiv).style.visibility = gBsStyVisHide;
  903.                     if (gbIE5) {
  904.                         tempColl(iDiv).style.position = "absolute";
  905.                     }
  906.                     tempColl(iDiv).style.pixelTop = "-100px";
  907.                     break;
  908.                 }
  909.             }
  910.         } else if (gbNav4) {
  911.             for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
  912.                 if (document.layers[iLayer].id == "NavBar") {
  913.                     document.layers[iLayer].visibility = gBsStyVisHide;
  914.                 }
  915.             }
  916.             if ((document.images.length > 0) && (document.images[0].src.indexOf('bsscnav1.gif') != -1)) {
  917.                 document.links[0].href = "javascript:void(null);";
  918.             }
  919.         }
  920.     }
  921.     
  922.     return;
  923. }
  924.  
  925.  
  926.  
  927. //////////////////////////////////////////////////////////////////////////////////////////////
  928. //
  929. //    Begin DHTML Popup Functions
  930. //
  931. //////////////////////////////////////////////////////////////////////////////////////////////
  932. //variables used to isolate the browser type
  933. var gBsDoc            = null;            
  934. var gBsSty            = null;
  935. var gBsHtm            = null;
  936. var gBsStyVisShow    = null;
  937. var gBsStyVisHide    = null;
  938. var gBsClientWidth    = 640;
  939. var gBsClientHeight = 480;
  940. var gBsBrowser        = null;
  941.  
  942. //the browser information itself
  943. function _BSPSBrowserItself()
  944. {
  945.     var agent  = navigator.userAgent.toLowerCase();
  946.     this.major = parseInt(navigator.appVersion);
  947.     this.minor = parseFloat(navigator.appVersion);
  948.     this.ns    = ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)));
  949.     this.ns2   = ((this.ns) && (this.major == 2));
  950.     this.ns3   = ((this.ns) && (this.major == 3));
  951.     this.ns4   = ((this.ns) && (this.major >= 4));
  952.     this.ie       = (agent.indexOf("msie") != -1);
  953.     this.ie3   = ((this.ie) && (this.major == 2));
  954.     this.ie4   = ((this.ie) && (this.major >= 4));
  955.     this.op3   = (agent.indexOf("opera") != -1);
  956.  
  957.     if (this.ns4)
  958.     {
  959.         gBsDoc        = "document";
  960.         gBsSty        = "";
  961.         gBsHtm        = ".document";
  962.         gBsStyVisShow    = "show";
  963.         gBsStyVisHide    = "hide";
  964.  
  965.     }
  966.     else if (this.ie4)
  967.     {
  968.         gBsDoc         = "document.all";
  969.         gBsSty         = ".style";
  970.         gBsHtm         = "";
  971.         gBsStyVisShow    = "visible";
  972.         gBsStyVisHide    = "hidden";
  973.     }
  974. }
  975.  
  976. //Here is the browser type 
  977. function _BSPSGetBrowserInfo()
  978. {
  979.     gBsBrowser    = new _BSPSBrowserItself();
  980. }
  981.  
  982. //Get client size info
  983. function _BSPSGetClientSize()
  984. {
  985.     if (gBsBrowser.ns4)
  986.     {
  987.         gBsClientWidth    = innerWidth;
  988.         gBsClientHeight = innerHeight;
  989.  
  990.     }
  991.     else if (gBsBrowser.ie4)
  992.     {
  993.         gBsClientWidth    = document.body.clientWidth;
  994.         gBsClientHeight = document.body.clientHeight;
  995.     }
  996. }
  997.  
  998.  
  999. var gstrPopupID = 'BSSCPopup';
  1000. var gstrPopupShadowID = 'BSSCPopupShadow';
  1001. var gstrPopupTopicID = 'BSSCPopupTopic';
  1002. var gstrPopupIFrameID = 'BSSCPopupIFrame';
  1003. var gstrPopupIFrameName = 'BSSCPopupIFrameName';
  1004.  
  1005. var gstrPopupSecondWindowName = 'BSSCPopup';
  1006.  
  1007. var    gPopupDiv = null;
  1008. var gPopupDivStyle = null;
  1009. var    gPopupShadow = null;
  1010. var    gPopupTopic = null;
  1011. var gPopupIFrame = null;
  1012. var gPopupIFrameStyle = null;
  1013. var gPopupWindow = null;
  1014. var gnPopupClickX = 0;
  1015. var gnPopupClickY = 0;
  1016.  
  1017. var gbPopupTimeoutExpired = false;
  1018.  
  1019. if (BSSCPopup_IsPopup()) {
  1020.     document.write("<base target=\"_parent\">");
  1021. }
  1022.  
  1023. function DHTMLPopupSupport()
  1024. {
  1025.     if ((gbIE4) && (!gbMac)) {
  1026.         return true;
  1027.     }
  1028.     return false;
  1029. }
  1030.  
  1031.  
  1032.  
  1033. function BSSCPopup_IsPopup()
  1034. {
  1035.     if (DHTMLPopupSupport() && (this.name == gstrPopupIFrameName)) {
  1036.         return true;
  1037.     } else if ((gbNav4 || gbIE4) && (this.name == gstrPopupID)) {
  1038.         return true;
  1039.     } else {
  1040.         return false;
  1041.     }
  1042. }
  1043.  
  1044. function _BSSCCreatePopupDiv()
  1045. {
  1046.     if (gPopupDiv == null) {
  1047.         if (DHTMLPopupSupport()) {
  1048.             document.write("<DIV ID='" + gstrPopupID + "' STYLE='position:absolute; width:0; height:0; top:-100; left:0; z-index:600; visibility:hidden;'>");
  1049.             document.write("<DIV ID='" + gstrPopupShadowID + "' STYLE=\"position:absolute;top:0; left:0;  width:0; height:0; background-color:#C0C0C0;\"></DIV>");
  1050.             document.write("<DIV ID='" + gstrPopupTopicID + "' STYLE=\"position:absolute;top:0; left:0;  width:0; height:0; background-color:#FFFFFF;border:1px #000000 outset;\">");
  1051.             document.write("<IFRAME ID='" + gstrPopupIFrameID + "' name='" + gstrPopupIFrameName + "' frameborder=0 scrolling=auto></IFRAME>");
  1052.             document.write("</DIV></DIV>");
  1053.             var tempColl = document.all.tags("DIV");
  1054.             for (var iDiv = 0; iDiv < tempColl.length; iDiv++) {
  1055.                 if (tempColl(iDiv).id == gstrPopupID) {
  1056.                     gPopupDiv = tempColl(iDiv);
  1057.                 }
  1058.                 if (tempColl(iDiv).id == gstrPopupShadowID) {
  1059.                     gPopupShadow = tempColl(iDiv);
  1060.                 }
  1061.                 if (tempColl(iDiv).id == gstrPopupTopicID) {
  1062.                     gPopupTopic = tempColl(iDiv);
  1063.                 }
  1064.             }
  1065.             
  1066.             gPopupIFrame = eval("gPopupDiv.document.frames['" + gstrPopupIFrameName + "']");
  1067.             gPopupDivStyle = eval("gPopupDiv" + gBsSty);
  1068.             gPopupIFrameStyle = eval(gBsDoc + "['" + gstrPopupIFrameName + "']" + gBsSty);
  1069.         }
  1070.     }
  1071. }
  1072.  
  1073. function BSSCPopup_Timeout()
  1074. {
  1075.     if ((gPopupIFrame.document.readyState == "complete") &&
  1076.         (gPopupIFrame.document.body != null)) {
  1077.         BSSCPopup_TimeoutReal();
  1078.     } else {
  1079.         setTimeout("BSSCPopup_Timeout()", 100);
  1080.     }
  1081. }
  1082.  
  1083. function BSSCPopup_TimeoutReal()
  1084. {
  1085.     window.gbPopupTimeoutExpired = true;
  1086.  
  1087.     if (gPopupIFrame.document) {
  1088.         gPopupIFrame.document.body.onclick = BSSCPopupClicked;
  1089.     }
  1090.     document.onmousedown = BSSCPopupParentClicked;
  1091. }
  1092.  
  1093. function BSPSPopupTopicWinHelp(strURL)
  1094. {
  1095.     _BSSCPopup(strURL);
  1096.     return;
  1097. }
  1098.  
  1099. function _BSSCPopup(strURL)
  1100. {
  1101.     if (DHTMLPopupSupport()) {
  1102.  
  1103.         // If we are already in a popup, replace the contents
  1104.         if (BSSCPopup_IsPopup()) {
  1105.  
  1106.             location.href = strURL;
  1107.             parent.window.gbPopupTimeoutExpired = false;
  1108.             if (gbMac) {
  1109.                 setTimeout("BSSCPopup_AfterLoad()", 400);
  1110.             } else {
  1111.                 setTimeout("BSSCPopup_AfterLoad()", 100);
  1112.             }
  1113.  
  1114.         } else {
  1115.  
  1116.             // Load the requested URL into the IFRAME
  1117.             gPopupIFrame.location.href = strURL;
  1118.             window.gbPopupTimeoutExpired = false;
  1119.             if (gbMac) {
  1120.                 setTimeout("BSSCPopup_AfterLoad()", 400);
  1121.             } else {
  1122.                 setTimeout("BSSCPopup_AfterLoad()", 100);
  1123.             }
  1124.         }
  1125.  
  1126.     } else {
  1127.  
  1128.         if (window.name == gstrPopupSecondWindowName) {
  1129.             window.location = strURL;
  1130.         } else {
  1131.  
  1132.             BSSCHidePopupWindow();
  1133.             var nX = 0;
  1134.             var nY = 0;
  1135.             var nHeight = 300;
  1136.             var nWidth = 400;
  1137.             _BSPSGetClientSize();
  1138.             if (gBsBrowser.ns4) {
  1139.                 nX = window.screenX + (window.outerWidth - window.innerWidth) + window.gnPopupClickX;
  1140.                 nY = window.screenY + (window.outerHeight - window.innerHeight) + window.gnPopupClickY;
  1141.                 if (nY + nHeight + 40 > screen.availHeight) {
  1142.                     nY = screen.availHeight - nHeight - 40;
  1143.                 }
  1144.                 if (nX + nWidth + 40 > screen.availWidth) {
  1145.                     nX = screen.availWidth - nWidth - 40;
  1146.                 }
  1147.             } else {
  1148.                 nX = window.gnPopupClickX;
  1149.                 nY = window.gnPopupClickX;
  1150.             }
  1151.  
  1152.             // Launch a separate window
  1153.             var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,";
  1154.             strParam += "height=" + nHeight + ",width=" + nWidth;
  1155.             strParam += ",screenX=" + nX + ",screenY=" + nY;
  1156.             window.gPopupWindow = window.open(strURL, gstrPopupSecondWindowName, strParam);
  1157.             if (gBsBrowser.ns4) {
  1158.                 window.gPopupWindow.captureEvents(Event.CLICK | Event.BLUE);
  1159.                 window.gPopupWindow.onclick = NonIEPopup_HandleClick;
  1160.                 window.gPopupWindow.onblur = NonIEPopup_HandleBlur;
  1161.             }
  1162.             else if (gBsBrowser.ie4)
  1163.             {
  1164.                 window.gPopupWindow.focus();
  1165.             }
  1166.         }
  1167.     }
  1168.  
  1169.     return;
  1170. }
  1171.  
  1172.  
  1173. function NonIEPopup_HandleBlur(e)
  1174. {
  1175.     window.gPopupWindow.focus();
  1176. }
  1177.  
  1178. function NonIEPopup_HandleClick(e)
  1179. {
  1180.     // Because navigator will give the event to the handler before the hyperlink, let's
  1181.     // first route the event to see if we are clicking on a Popup menu in a popup.
  1182.     document.routeEvent(e);
  1183.  
  1184.     // If a popup menu is active then don't do anything with the click
  1185.     if (window.gPopupWindow.gbInPopupMenu) {
  1186.         window.gPopupWindow.captureEvents(Event.CLICK);
  1187.         window.gPopupWindow.onclick = NonIEPopup_HandleClick;
  1188.         return false;
  1189.     }
  1190.  
  1191.     // Close the popup window
  1192.     if (e.target.href != null) {
  1193.         window.location.href = e.target.href;
  1194.         if (e.target.href.indexOf("BSSCPopup") == -1) {
  1195.             this.close();
  1196.         }
  1197.     } else {
  1198.         this.close();
  1199.     }
  1200.     return false;
  1201. }
  1202.  
  1203. function BSSCPopup_AfterLoad()
  1204. {
  1205.     if ((window.gPopupIFrame.document.readyState == "complete") &&
  1206.         (window.gPopupIFrame.document.body != null)) {
  1207.         BSSCPopup_ResizeAfterLoad();
  1208.     } else {
  1209.         setTimeout("BSSCPopup_AfterLoad()", 200);
  1210.     }
  1211. }
  1212.  
  1213.  
  1214. function BSSCPopup_ResizeAfterLoad()
  1215. {
  1216.     window.gPopupDivStyle.visibility = gBsStyVisHide;
  1217.  
  1218.     // Determine the width and height for the window
  1219.     var size = new BSSCSize(0, 0);
  1220.     BSSCGetContentSize(window.gPopupIFrame, size);
  1221.     var nWidth = size.x;
  1222.     var nHeight = size.y;
  1223.     _BSPSGetClientSize();
  1224.     if (nWidth > gBsClientWidth) {
  1225.         // Adjust the height by 1/3 of how much we are reducing the width
  1226.         var lfHeight = 1.0;
  1227.         lfHeight = (((nWidth / (gBsClientWidth - 20.0)) - 1.0) * 0.3333) + 1.0;
  1228.         lfHeight *= nHeight;
  1229.         nHeight = lfHeight;
  1230.         nWidth = gBsClientWidth - 20;
  1231.     }
  1232.     if (nHeight > gBsClientHeight * .67) {
  1233.         nHeight = gBsClientHeight / 2;
  1234.     }
  1235.     window.gPopupDivStyle.width = nWidth;
  1236.     window.gPopupDivStyle.height = nHeight;
  1237.  
  1238.     // Determine the position of the window
  1239.     var nClickX = window.gnPopupClickX;
  1240.     var nClickY = window.gnPopupClickY;
  1241.     var nTop = 0;
  1242.     var nLeft = 0;
  1243.  
  1244.     if (nClickY + nHeight + 20 < gBsClientHeight + document.body.scrollTop) {
  1245.         nTop = nClickY + 10;
  1246.     } else {
  1247.         nTop = (document.body.scrollTop + gBsClientHeight) - nHeight - 20;
  1248.     }
  1249.     if (nClickX + nWidth < gBsClientWidth + document.body.scrollLeft) {
  1250.         nLeft = nClickX;
  1251.     } else {
  1252.         nLeft = (document.body.scrollLeft + gBsClientWidth) - nWidth - 8;
  1253.     }
  1254.     if (nTop <0) nTop  = 1;
  1255.     if (nLeft<0) nLeft = 1;
  1256.  
  1257.  
  1258.     window.gPopupDivStyle.left = nLeft;
  1259.     window.gPopupDivStyle.top = nTop;
  1260.  
  1261.     // Set the location of the background blocks
  1262.     window.gPopupShadow.style.left = 6;
  1263.     window.gPopupShadow.style.top = 6;
  1264.     window.gPopupShadow.style.width = nWidth;
  1265.     window.gPopupShadow.style.height = nHeight;
  1266.     window.gPopupTopic.style.width = nWidth;
  1267.     window.gPopupTopic.style.height = nHeight;
  1268.  
  1269.     if (gbMac) {
  1270.         // Total hack on the iMac to get the IFrame to position properly
  1271.         window.gPopupIFrameStyle.pixelLeft = 100;
  1272.         window.gPopupIFrameStyle.pixelLeft = 0;
  1273.         // Explicitly call BSSCOnLoad because the Mac doesn't seem to do it
  1274.         window.gPopupIFrame.window.BSSCOnLoad();
  1275.     }
  1276.     window.gPopupIFrameStyle.width = nWidth;
  1277.     window.gPopupIFrameStyle.height = nHeight;
  1278.  
  1279.     window.gPopupDivStyle.visibility = gBsStyVisShow;
  1280.  
  1281.     setTimeout("BSSCPopup_Timeout();", 100);
  1282.     return false;
  1283. }
  1284.  
  1285.  
  1286. function    BSSCSize(x, y)
  1287. {
  1288.     this.x = x;
  1289.     this.y = y;
  1290. }
  1291.  
  1292. function BSSCGetContentSize(thisWindow, size)
  1293. {
  1294.     if (!((gBsBrowser.ie4) || (gBsBrowser.ns4)))
  1295.         return;
  1296.  
  1297.     if (gbMac) {
  1298.         size.x = 300;
  1299.         size.y = 300;
  1300.         return;
  1301.     }
  1302.  
  1303.     // Resize the width until it is wide enough to handle the content
  1304.     // The trick is to start wide and determine when the scrollHeight changes
  1305.     // because then we know a scrollbar is necessary. We can then go back
  1306.     // to the next widest size (for no scrollbar)
  1307.     size.x = 800;
  1308.     var y = 1;
  1309.     var x = 800;
  1310.  
  1311.     // This double resize causes the document to re-render (and we need it to)
  1312.     thisWindow.resizeTo(1, 1);
  1313.     thisWindow.resizeTo(1, 1);
  1314.     thisWindow.resizeTo(x, thisWindow.document.body.scrollHeight);
  1315.     thisWindow.resizeTo(x, thisWindow.document.body.scrollHeight);
  1316.     var miny = thisWindow.document.body.scrollHeight;
  1317.     size.y = miny;
  1318. //    alert('firstsizex :' + resizeInfo.RstX + "    firstsizey :" + resizeInfo.RstY);
  1319.     for (i = 7; i > 0; i--) {
  1320.         x = i * 100;
  1321.         thisWindow.resizeTo(x, miny);
  1322.         thisWindow.resizeTo(x, miny);
  1323. //        alert('testsizex :' + x + "    testsizey :" + miny);
  1324.         if ((thisWindow.document.body.scrollHeight > miny) ||
  1325.             (thisWindow.document.body.scrollWidth > x)) {
  1326.             x = (i + 1) * 100;
  1327.             thisWindow.resizeTo(x, y);
  1328.             thisWindow.resizeTo(x, y);
  1329.             size.x = thisWindow.document.body.scrollWidth + 20;
  1330.             size.y = thisWindow.document.body.scrollHeight + 20;
  1331.             break;
  1332.         }
  1333.     }
  1334.  
  1335.     // Handle absurd cases just in case IE flakes
  1336.     if (size.y < 100) {
  1337.         size.y = 100;
  1338.     }
  1339. //    alert('sizex :' + size.x + "    sizey :" + size.y);
  1340.     thisWindow.resizeTo(size.x, size.y);
  1341.     thisWindow.resizeTo(size.x, size.y);
  1342.  
  1343.     return;
  1344. }
  1345.  
  1346.  
  1347.  
  1348. function BSSCPopupParentClicked()
  1349. {
  1350.     BSSCPopupClicked();
  1351.     return;
  1352. }
  1353.  
  1354.  
  1355. function BSSCPopupClicked()
  1356. {
  1357.     if (!window.gbPopupTimeoutExpired) {
  1358.         return false;
  1359.     }
  1360.  
  1361.     if (gPopupIFrame.window.gbInPopupMenu) {
  1362.         return false;
  1363.     }
  1364.  
  1365.     // Give the user a message about javascript calls through objects.
  1366.     if ((gPopupIFrame.window.event != null) &&
  1367.         (gPopupIFrame.window.event.srcElement != null) &&
  1368.         (gPopupIFrame.window.event.srcElement.tagName == "A") &&
  1369.         (gPopupIFrame.window.event.srcElement.href.indexOf("javascript:") == 0) &&
  1370.         (gPopupIFrame.window.event.srcElement.href.indexOf(".") != -1)) {
  1371.         gPopupIFrame.window.event.cancelBubble = true;
  1372.         alert('Hyperlinks to objects do not work in popups.');
  1373.         return false;
  1374.     }
  1375.  
  1376.     if (gPopupIFrame.document) {
  1377.         gPopupIFrame.document.body.onclick = null;
  1378.     }
  1379.     document.onclick = null;
  1380.     document.onmousedown = null;
  1381.  
  1382.     // Simply hide the popup
  1383.     gPopupDivStyle.visibility = gBsStyVisHide;
  1384.  
  1385.     return true;
  1386. }
  1387.  
  1388.  
  1389. //trace the mouse over's position for hotspot
  1390. function  BSPSPopupOnMouseOver(event)
  1391. {
  1392.     if (gBsBrowser.ie4) {
  1393.         window.gnPopupClickX = event.clientX + document.body.scrollLeft;
  1394.         window.gnPopupClickY = event.clientY + document.body.scrollTop;
  1395.     } else if (gBsBrowser.ns4) {
  1396.         window.gnPopupClickX = event.pageX;
  1397.         window.gnPopupClickY = event.pageY;
  1398.     }
  1399. }
  1400.  
  1401. function BSSCHidePopupWindow()
  1402. {
  1403.     if (window.gPopupWindow != null) {
  1404.         if (gBsBrowser.ns4) {
  1405.             if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) {
  1406.                 window.gPopupWindow.close();
  1407.                 window.gPopupWindow = null;
  1408.             }
  1409.         }
  1410.     }
  1411.  
  1412.     return;
  1413. }
  1414.  
  1415. var gbPopupMenuTimeoutExpired = false;
  1416. var gbInPopupMenu = false;
  1417. var gbPopupMenuTopicList = null;
  1418.  
  1419. //////////////////////////////////////////////////////////////////////////////////////////
  1420. //
  1421. // Popup Menu code
  1422. //
  1423. //////////////////////////////////////////////////////////////////////////////////////////
  1424.  
  1425.  
  1426. function _WritePopupMenuLayer()
  1427. {
  1428.     document.write("<DIV ID='PopupMenu' STYLE='position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;'></DIV>");
  1429.     if (gbNav4) {
  1430. //Do not try to write ininle styles for NS!  NS can not handle it and will not stop downloading the html page...
  1431. //        document.write(".PopupOver {color:white; background:navy; font-size:9pt; text-decoration:none;}");
  1432. //        document.write(".PopupNotOver {color:black; background:#c0c0c0; font-size:9pt; text-decoration:none;}");
  1433.     } else if (gbIE4) {
  1434.         document.write("<STYLE TYPE='text/css'>");
  1435.         if (gbMac) {
  1436.             document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:10pt; text-decoration:none;}");
  1437.             document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:10pt; text-decoration:none;}");
  1438.         } else {
  1439.             document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:8pt; text-decoration:none;}");
  1440.             document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:8pt; text-decoration:none;}");
  1441.         }
  1442.         document.write("</STYLE>");
  1443.     }
  1444. }
  1445.  
  1446. //Define variable arguments as: strTitle, strUrl
  1447. function PopupMenuTopicEntry() 
  1448. {
  1449.     this.strTitle = PopupMenuTopicEntry.arguments[0];
  1450.     this.strURL = PopupMenuTopicEntry.arguments[1];
  1451. }
  1452.  
  1453. // If the topic list is set, it is an array of TopicEntry objects (defined in WebHelp3.js)
  1454. function PopupMenu_SetTopicList(aPopupTopicArray)
  1455. {
  1456.     gbPopupMenuTopicList = aPopupTopicArray;
  1457. }
  1458.  
  1459. //Seek for the bsscright frame 
  1460. function _SeekFrameByName( cRoot, strName )
  1461. {
  1462.     if( cRoot == null )    return null;
  1463.     if( cRoot.frames == null )    return null;
  1464.     if( cRoot.frames[strName] != null )    return cRoot.frames[strName];
  1465.     for (var i=0; i<cRoot.frames.length; i++)
  1466.     {
  1467.         var cObj = _SeekFrameByName( cRoot.frames(i).document, strName );
  1468.         if( cObj != null )        return cObj;
  1469.     };
  1470.     return null;
  1471. }
  1472. function _GetFrameByName( cRoot, strName )
  1473. {
  1474.     if( cRoot == null )    return null;
  1475.     var cRet = _SeekFrameByName(cRoot, strName);
  1476.     if( cRet != null )    return cRet;
  1477.     return _GetFrameByName( cRoot.parent, strName );
  1478. }
  1479.  
  1480. function _PopupMenu_Invoke(fn_arguments)
  1481. {
  1482.     if ((!gbIE4 && !gbNav4) || ((gbMac) && (gbIE4) && (window.event.srcElement.tagName == "AREA"))) {
  1483.     
  1484.         var argLen     = fn_arguments.length;
  1485.  
  1486.         // Create the window that the hyperlinks will go into
  1487.         var nHeight = argLen * 15;
  1488.         var nWidth = 400;
  1489.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
  1490.         strParam += ",height=" + nHeight + ",width=200";
  1491.         strParam += ",resizable";
  1492.  
  1493.         // Create a temporary window first to ensure the real popup comes up on top
  1494.         var wndTemp = window.open("", "temp", strParam);
  1495.  
  1496.         // Create the real popup window
  1497.         var wndPopupLinks = window.open("", "popuplinks", strParam);
  1498.  
  1499.         // Close the temporary
  1500.         wndTemp.close();
  1501.  
  1502.         wndPopupLinks.document.open("text/html");
  1503.         wndPopupLinks.document.write("<html><head></head>");
  1504.         wndPopupLinks.document.write("<body onBlur=\'self.focus();\'>");
  1505.         var strParaLine = "";
  1506.         for (var i = 0; i < (argLen - 2) / 2; i++) {
  1507.             strParaLine = "";
  1508.             strParaLine += "<a href=\"javascript:";
  1509.             if (gbIE) {
  1510.                 strParaLine += "onBlur=null; ";
  1511.             }
  1512.             strParaLine += "opener.location=\'";
  1513.             strParaLine += fn_arguments[2 * i + 3];
  1514.             strParaLine += "\';close();\"";
  1515.             if (fn_arguments[1] != '') {
  1516.                 strParaLine += " TARGET='" + fn_arguments[1] + "'";
  1517.             }
  1518.             strParaLine += ">";
  1519.             strParaLine += fn_arguments[2 * i + 2];
  1520.             strParaLine += "</a>";
  1521.             strParaLine += "<br>";
  1522.             wndPopupLinks.document.write(strParaLine);
  1523.         }
  1524.         wndPopupLinks.document.write("</body></html>");
  1525.         wndPopupLinks.document.close();
  1526.         window.gbInPopupMenu = true;
  1527.         if (!gbIE) {
  1528.             wndPopupLinks.focus();
  1529.         }
  1530.  
  1531.         return false;
  1532.     }
  1533.  
  1534.     // Make sure we have reasonable arguments
  1535.     var argLen = fn_arguments.length;
  1536.     if (argLen < 3) {
  1537.         return false;
  1538.     }
  1539.  
  1540.     // Check to see if we only have one target
  1541.     var strTarget = "";
  1542.     if (((argLen < 5) && (isNaN(fn_arguments[2]))) ||
  1543.         ((argLen < 4) && (!isNaN(fn_arguments[2])))) {
  1544.  
  1545.         // Get the place that we will be putting the topic into
  1546.         var targetDoc = null;
  1547.         if (fn_arguments[1] == '') {
  1548.             targetDoc = window.document;
  1549.         } else {
  1550.             targetDoc = _GetFrameByName( parent, fn_arguments[1] );
  1551.             if (targetDoc == null) {
  1552.                 targetDoc  = window.document;
  1553.             }
  1554.             //if (gbIE4) {
  1555.             //        targetDoc = eval("top.document.frames['" + fn_arguments[1] + "']");
  1556.             //    } else if (gbNav4) {
  1557.             //    targetDoc = eval("window.top." + fn_arguments[1] + ".document");
  1558.             //}
  1559.             strTarget = "TARGET='" + fn_arguments[1] + "'";
  1560.         }
  1561.         if (isNaN(fn_arguments[2])) {
  1562.             targetDoc.location.href = fn_arguments[3];
  1563.         } else {
  1564.             targetDoc.location.href = gbPopupMenuTopicList[fn_arguments[2]].strURL;
  1565.         }
  1566.         return false;
  1567.     }
  1568.     
  1569.     var strMenu = "";
  1570.     if (gbNav4) {
  1571.         strMenu = '<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=3 BGCOLOR="#c0c0c0">';
  1572.     } else {
  1573.         strMenu = '<TABLE STYLE="border:2px outset white;" CELLSPACING=0';
  1574.         if (gbMac) {
  1575.             strMenu += ' CELLPADDING=4';
  1576.         } else {
  1577.             strMenu += ' CELLPADDING=2';
  1578.         }    
  1579.         strMenu += ' BGCOLOR=#c0c0c0>';
  1580.     }
  1581.  
  1582.     // Add each of the items
  1583.     var i = 2;
  1584.     while (i <= argLen - 1) {
  1585.         strMenu += '<TR><TD><NOBR>'
  1586.         // If the destination is a number then look it up in the topic list
  1587.         if (isNaN(fn_arguments[i])) {
  1588.             strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + fn_arguments[i + 1] + '"' + strTarget;
  1589.         } else {
  1590.             strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + gbPopupMenuTopicList[fn_arguments[i]].strURL + '"' + strTarget;
  1591.         }
  1592.         strMenu += ' onclick="PopupMenu_HandleClick(event);"';
  1593.         strMenu += ' onmouseover="PopupMenu_Over(event);"';
  1594.         strMenu += ' onmouseout="PopupMenu_Out(event);"';
  1595.         strMenu += '>';
  1596.         if (isNaN(fn_arguments[i])) {
  1597.             strMenu += '<SPAN CLASS="PopupNotOver">' + fn_arguments[i] + '</SPAN>';
  1598.         } else {
  1599.             strMenu += '<SPAN CLASS="PopupNotOver">' + gbPopupMenuTopicList[fn_arguments[i]].strTitle + '</SPAN>';
  1600.         }
  1601.         strMenu += '</A></DIV></NOBR></TD></TR>';
  1602.  
  1603.         if (isNaN(fn_arguments[i])) {
  1604.             i += 2;
  1605.         } else {
  1606.             i += 1;
  1607.         }
  1608.     }
  1609.     strMenu += "</TABLE>";
  1610.  
  1611.     var layerPopup = null;
  1612.     var stylePopup = null;
  1613.     var nEventX = 0;
  1614.     var nEventY = 0;
  1615.     var nWindowWidth = 0;
  1616.     if (gbIE4) {
  1617.  
  1618.         layerPopup = document.all["PopupMenu"];
  1619.         layerPopup.innerHTML = strMenu;
  1620.         stylePopup = layerPopup.style;
  1621.  
  1622.         _BSPSGetClientSize();
  1623.  
  1624.         // Get the position of the item causing the event (relative to its parent)
  1625.         //if (gbMac) {
  1626.         if (true) {
  1627.             nEventX = window.event.clientX;
  1628.             nEventY = window.event.clientY;
  1629.         } else {
  1630.             //??? YJ: Can not remember why we calculate envent position by following code...
  1631.             //but it is wrong in a case like: CENTER->P->TABLE:
  1632.             //the offset positions of TABLE, P and CENTER are same (same offsetTop,offsetLeft)
  1633.             //so we get triple times of offset of x and y as we expect... 
  1634.  
  1635.             nEventX = window.event.srcElement.offsetLeft - document.body.scrollLeft;
  1636.             nEventY = window.event.srcElement.offsetTop - document.body.scrollTop;
  1637.  
  1638.             // Get the location of the parent
  1639.             var nParentLocX = 0;
  1640.             var nParentLocY = 0;
  1641.  
  1642.             var ParentItem = window.event.srcElement.offsetParent;
  1643.             while (ParentItem != null) {
  1644.                 if (ParentItem.offsetLeft)    {
  1645.                     nParentLocX += ParentItem.offsetLeft;
  1646.                     nParentLocY += ParentItem.offsetTop;
  1647.                 }
  1648.                 ParentItem = ParentItem.parentElement;
  1649.             }
  1650.  
  1651.             // Adjust the location of the item using the location of the parent(s)
  1652.             nEventX += nParentLocX;
  1653.             nEventY += nParentLocY;
  1654.         }
  1655.  
  1656.         if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) {
  1657.             nEventY += document.body.scrollTop + 10;
  1658.         } else {
  1659.             nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20;
  1660.         }
  1661.         stylePopup.top = nEventY;
  1662.  
  1663.         if (nEventX + layerPopup.scrollWidth + 20 > gBsClientWidth) {
  1664.             if (gBsClientWidth - layerPopup.scrollWidth < 5) {
  1665.                 stylePopup.left = 5;
  1666.             } else {
  1667.                 stylePopup.left = gBsClientWidth - layerPopup.scrollWidth - 5;
  1668.             }
  1669.         } else {
  1670.             stylePopup.left = nEventX + document.body.scrollLeft + 20;
  1671.         }
  1672.  
  1673.         stylePopup.visibility = "visible";
  1674.         document.onclick = PopupMenu_HandleClick;
  1675.     } else if (gbNav4) {
  1676.         layerPopup = document.layers.PopupMenu;
  1677.         layerPopup.visibility = "hide";
  1678.         stylePopup = layerPopup.document;
  1679.         stylePopup.write(strMenu);
  1680.         stylePopup.close();
  1681.         var e = fn_arguments[0];
  1682.         nEventX = e.pageX;
  1683.         nEventY = e.pageY;
  1684.         _BSPSGetClientSize();
  1685.         if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) {
  1686.             nEventY += 20;
  1687.         } else {
  1688.             nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20;
  1689.         }
  1690.         layerPopup.top = nEventY;
  1691.  
  1692.         if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) {
  1693.             if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) {
  1694.                 nEventX = 5;
  1695.             } else {
  1696.                 nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20;
  1697.             }
  1698.         } else {
  1699.             nEventX += 20;
  1700.         }
  1701.  
  1702.         layerPopup.left = nEventX;
  1703.  
  1704.         layerPopup.visibility = "show";
  1705.  
  1706. //        window.captureEvents(Event.CLICK | Event.MOUSEDOWN);
  1707.         window.captureEvents(Event.MOUSEDOWN);
  1708. //        window.onclick = PopupMenu_HandleClick;
  1709.         window.onmousedown = PopupMenu_HandleClick;
  1710.     }
  1711.  
  1712.     window.gbInPopupMenu = true;
  1713.     window.gbPopupMenuTimeoutExpired = false;
  1714.     setTimeout("PopupMenu_Timeout();", 100);
  1715.     return false;
  1716. }
  1717.  
  1718.  
  1719. function PopupMenu_Timeout()
  1720. {
  1721.     window.gbPopupMenuTimeoutExpired = true;
  1722. }
  1723.  
  1724. function PopupMenu_Over(e)
  1725. {
  1726.     if (gbIE4) {
  1727.         e.srcElement.className = "PopupOver";
  1728.     } else if (gbNav4) {
  1729. //        this.bgColor = "red";
  1730. //        e.target.document.className = "PopupOver";
  1731.     }
  1732.     return;
  1733. }
  1734.  
  1735. function PopupMenu_Out(e)
  1736. {
  1737.     if (gbIE4) {
  1738.         e.srcElement.className = "PopupNotOver";
  1739.     } else if (gbNav4) {
  1740.         this.bgColor = "#f0f0f0";
  1741.     }
  1742.     return;
  1743. }
  1744.  
  1745.  
  1746. function PopupMenu_HandleClick(e)
  1747. {
  1748.     if (!window.gbPopupMenuTimeoutExpired) {
  1749.         return;
  1750.     }
  1751.  
  1752.     window.gbInPopupMenu = false;
  1753.  
  1754.     if (gbNav4) {
  1755. //        window.releaseEvents(Event.CLICK);
  1756.         window.releaseEvents(Event.MOUSEDOWN);
  1757.     }
  1758.  
  1759.     var layerPopup = null;
  1760.     var stylePopup = null;
  1761.     if (gbIE4) {
  1762.         layerPopup = document.all["PopupMenu"];
  1763.         stylePopup = layerPopup.style;
  1764.         stylePopup.visibility = "hidden";
  1765.     } else if (gbNav4) {
  1766.         layerPopup = document.layers.PopupMenu;
  1767.         layerPopup.visibility = "hide";
  1768.     }
  1769.  
  1770.     return;
  1771. }
  1772.  
  1773. // This function should be deleted when all old projects are cleaned up
  1774. function BSPSWritePopupFrameForIE4()
  1775. {
  1776.     return false;
  1777. }
  1778.  
  1779. /////////////////////////////////////////////////////////////////////
  1780. function BSSCPopup_ClickMac()
  1781. {
  1782.     if ((!DHTMLPopupSupport()) && (gbIE4))
  1783.     {    
  1784.         var bClickOnAnchor = false;
  1785.         var el;
  1786.         if ((window.event != null) &&
  1787.             (window.event.srcElement != null))
  1788.         {
  1789.             el = window.event.srcElement;
  1790.             while (el != null)
  1791.             {
  1792.                 if ((el.tagName == "A") || (el.tagName == "AREA"))     {
  1793.                     bClickOnAnchor = true;
  1794.                     break;
  1795.                 }
  1796.                 if (el.tagName == "BODY") {
  1797.                     break;
  1798.                 }
  1799.                 el = el.parentElement;
  1800.             }
  1801.         }
  1802.         if (BSSCPopup_IsPopup())
  1803.         {
  1804.             if (!bClickOnAnchor) {
  1805.                 parent.window.gPopupWindow = null;
  1806.                 self.close();
  1807.             }
  1808.         }
  1809.         else
  1810.         {
  1811.             bClosePopupWindow = true;
  1812.             if ((bClickOnAnchor) &&
  1813.                 (el.href) &&
  1814.                 (el.href.indexOf("javascript:BSSCPopup") != -1))
  1815.             {
  1816.                 bClosePopupWindow = false;
  1817.             }
  1818.             if (bClosePopupWindow)
  1819.             {
  1820.                 if (window.gPopupWindow != null)
  1821.                 {
  1822.                     var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400";
  1823.                     window.gPopupWindow = window.open("", gstrPopupSecondWindowName,strParam);
  1824.                     window.gPopupWindow.close();
  1825.                     window.gPopupWindow = null;
  1826.                 }
  1827.             }
  1828.         }
  1829.     }
  1830.  }
  1831.  
  1832. //////////////////////////////////////////////////////////////////////
  1833.  
  1834. _BSPSGetBrowserInfo();
  1835.  
  1836. function _BSSCOnLoad()
  1837. {
  1838.     if (!gbIE4 && !gbNav4)
  1839.         return;
  1840.  
  1841.     // Make everything visible in navigator
  1842.     if (gbNav4) {
  1843.         // Make some special effects items visible
  1844.         for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
  1845.             document.layers[iLayer].visibility = gBsStyVisShow;
  1846.             document.layers[iLayer].left = 0;
  1847.         }
  1848.     }
  1849.  
  1850.     // Remove the NavBar if necessary
  1851.     RemoveNavBar();
  1852.         
  1853.     // Don't continue without IE4
  1854.     if (gbIE4) {
  1855.         HHActivateComponents();
  1856.         doStaticEffects();
  1857.         startAnimationSet(0);
  1858.     }
  1859. }
  1860.  
  1861. function _BSSCOnUnload()
  1862. {
  1863. }
  1864.  
  1865. function _BSSCOnClick()
  1866. {
  1867.     if (!gbIE4)
  1868.         return;
  1869.  
  1870.     BSSCPopup_ClickMac();
  1871.     startNextAnimationSet();
  1872. }
  1873.  
  1874. //////////BSSCDHTML Section Embedded Code//////////
  1875. var s_strAgent = navigator.userAgent.toLowerCase();
  1876. var s_nVer       = parseInt(navigator.appVersion);
  1877.  
  1878. var s_bIE  = (s_strAgent.indexOf('msie') != -1);
  1879. var s_bNS  = (s_strAgent.indexOf('mozilla') != -1) && ((s_strAgent.indexOf('spoofer') == -1) && (s_strAgent.indexOf('compatible') == -1));
  1880. var s_bOpera    = (s_strAgent.indexOf('opera') != -1);
  1881.  
  1882. var s_bIE3Before = ((s_bIE) && (s_nVer <= 2));
  1883. var s_bNS3Before = ((s_bNS) && (s_nVer <= 3));
  1884.  
  1885. var s_bNS2        = ((s_bNS) && (s_nVer <= 2));
  1886. var s_bNS3        = ((s_bNS) && (s_nVer == 3));
  1887. var s_bIE300301    = ((s_bIE) && (s_nVer == 2) && ((s_strAgent.indexOf("3.00") != -1)||(s_strAgent.indexOf("3.0a") != -1)||(s_strAgent.indexOf("3.0b")!=-1)||(s_strAgent.indexOf("3.01")!=-1)));
  1888. var s_bIE302    = ((s_bIE) && (s_nVer == 2) && (s_strAgent.indexOf("3.02") != -1));
  1889.  
  1890.  
  1891. function HasExtJs()
  1892. {
  1893.     if (s_bIE3Before) { return false;}
  1894.     if (s_bNS3Before) {    return false;}
  1895.     if (typeof (_BSSCOnLoad) == "undefined"){ return false; }
  1896.     return true;
  1897. }
  1898.  
  1899. function BSSCOnLoad()
  1900. {
  1901.     if (HasExtJs()) { _BSSCOnLoad(); }
  1902. }
  1903.  
  1904. function BSSCOnUnload()
  1905. {
  1906.     if (HasExtJs()) { _BSSCOnUnload(); }
  1907. }
  1908.  
  1909. function BSSCOnClick()
  1910. {
  1911.     if (HasExtJs()) { _BSSCOnClick(); }
  1912. }
  1913.  
  1914. function WritePopupMenuLayer()
  1915. {
  1916.     if (HasExtJs()) {_WritePopupMenuLayer();}
  1917. }
  1918.  
  1919. function BSSCCreatePopupDiv()
  1920. {
  1921.     if (HasExtJs()) {_BSSCCreatePopupDiv();    }
  1922. }
  1923.  
  1924. function BSSCPopup(strURL)
  1925. {
  1926.     if (HasExtJs())    { 
  1927.         _BSSCPopup(strURL);
  1928.     }else{
  1929.         //Create a temporary window first to ensure the real popup comes up on top
  1930.         var wndTemp = null;
  1931.         if (!s_bNS3) {
  1932.             wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
  1933.         }
  1934.         // Create the real popup window
  1935.         var wndPopup = window.open(strURL, "PopupWindow", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400");
  1936.         // Close the temporary
  1937.         if (!s_bNS3) {
  1938.             wndTemp.close();
  1939.         } else {
  1940.             wndPopup.focus();
  1941.         }
  1942.     }
  1943. }
  1944.  
  1945.  
  1946. function PopupMenu_Invoke()
  1947. {
  1948.     if (HasExtJs()) {
  1949.         return _PopupMenu_Invoke(PopupMenu_Invoke.arguments);
  1950.     }
  1951.     if (s_bNS3Before || s_bIE3Before )    {
  1952.         var argLen     = PopupMenu_Invoke.arguments.length;
  1953.         if (argLen < 5) {
  1954.             window.document.location.href = PopupMenu_Invoke.arguments[3];
  1955.             return false;
  1956.         }
  1957.         var nHeight = argLen * 15;
  1958.         var nWidth = 400;
  1959.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
  1960.         strParam += ",height=" + nHeight + ",width=200,resizable";
  1961.         
  1962.         //Create a temporary window first to ensure the real popup comes up on top
  1963.         var wndTemp = null;
  1964.         if (!s_bNS3) {
  1965.             wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
  1966.         }
  1967.  
  1968.         var wndPopupLinks = window.open("", "popuplinks", strParam);
  1969.         wndPopupLinks.document.open("text/html");
  1970.         wndPopupLinks.document.write("<html><head>");
  1971.         if (s_bNS2 || s_bOpera) {
  1972.             wndPopupLinks.document.write("<base href=\"" + location +"\">");
  1973.         } else {
  1974.             //YJ: IE301,302 and NS3.x works fine
  1975.             wndPopupLinks.document.write("<");
  1976.             wndPopupLinks.document.write("script>");
  1977.             wndPopupLinks.document.write("function gotoUrl(aUrl) {opener.window.location=aUrl; close();}");
  1978.             wndPopupLinks.document.write("<");
  1979.             wndPopupLinks.document.write("/script>");
  1980.         }
  1981.         wndPopupLinks.document.write("</head><body onBlur=\'self.focus();\'>");
  1982.         var strParaLine = "";
  1983.         for (var i = 0; i < (argLen - 2) / 2; i++) {
  1984.             strParaLine = "";
  1985.             if (s_bNS2 || s_bOpera){
  1986.                 strParaLine += "<a href=\"";
  1987.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
  1988.                 strParaLine += "\">"
  1989.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
  1990.                 strParaLine += "</a>";
  1991.             } else {
  1992.                 strParaLine += "<a href=\"javascript:";
  1993.                 strParaLine += "gotoUrl(\'";
  1994.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
  1995.                 strParaLine += "\');\"";
  1996.                 if (PopupMenu_Invoke.arguments[1] != '') {
  1997.                     strParaLine += " TARGET='" + PopupMenu_Invoke.arguments[1] + "'";
  1998.                 }
  1999.                 strParaLine += ">";
  2000.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
  2001.                 strParaLine += "</a>";
  2002.             }
  2003.             strParaLine += "<br>";
  2004.             wndPopupLinks.document.write(strParaLine);
  2005.         }
  2006.         wndPopupLinks.document.write("</body></html>");
  2007.         wndPopupLinks.document.close();
  2008.  
  2009.         // Close the temporary
  2010.         if (!s_bNS3) {
  2011.             wndTemp.close();
  2012.         }else {
  2013.             wndPopupLinks.focus();
  2014.         }
  2015.  
  2016.         return true;
  2017.     }
  2018.     return false;
  2019. }
  2020.   
  2021.