home *** CD-ROM | disk | FTP | other *** search
/ ftp.americansys.com / 2014.06.ftp.americansys.com.tar / ftp.americansys.com / plott / NexTech_Practice_Manual.chm / bsscdhtm.js < prev    next >
Text File  |  2013-06-22  |  79KB  |  2,446 lines

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