home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2002 August / INTERNET94.ISO / pc / software / windows / mail / ft_gate_office / officewebhelp / bsscdhtm.js next >
Encoding:
JavaScript  |  2000-08-02  |  70.2 KB  |  2,292 lines

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