home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Shareware / Grafica / diagramstudio / DiagramStudio30_Setup.exe / ð / DiagramStudio.chm / bsscdhtm.js < prev    next >
Encoding:
JavaScript  |  2004-03-12  |  71.9 KB  |  2,348 lines

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