home *** CD-ROM | disk | FTP | other *** search
/ Geek 6 / Geek-006.iso / audio / jukebox / siren / sfsiren.cab / sfsiren.chm / bsscdhtm.js < prev    next >
Text File  |  2000-12-20  |  21KB  |  614 lines

  1. // RoboHELP« HTML Edition Dynamic HTML Effects Script
  2. // Copyright ⌐ 1998 Blue Sky Software Corporation.  All rights reserved.
  3.  
  4. // Version=1.1
  5.  
  6. // Warning:  Do not modify this file.  It is generated by RoboHELP« HTML Edition and changes will be overwritten.
  7.  
  8. function animationContext(el, progressAnimation, finishAnimiation, animationDuration, animationPeriod)
  9. {
  10.     this.el = el;
  11.     this.progressAnimation = progressAnimation;
  12.     this.finishAnimiation = finishAnimiation;
  13.     this.animationDuration = parseFloat(animationDuration);
  14.     this.animationPeriod = animationPeriod;
  15.     this.animationStartTime = (new Date()).getTime();
  16.     this.continueAnimation = true;
  17. }
  18.  
  19. function progressFade(ndx)
  20. {
  21.     percent = ((new Date()).getTime() - animationContexts[ndx].animationStartTime)/animationContexts[ndx].animationDuration;
  22.     if (percent > 1.0)
  23.     {
  24.         percent = 1.0;
  25.         animationContexts[ndx].continueAnimation = false;
  26.     }
  27.     animationContexts[ndx].el.filters.alpha.opacity = animationContexts[ndx].initialOpacity*(1.0-percent) +  animationContexts[ndx].finalOpacity*percent;
  28. }
  29.  
  30. function finishFade(ndx)
  31. {
  32.     animationContexts[ndx].el.filters.alpha.opacity = parseInt(animationContexts[ndx].finalOpacity);
  33. }
  34.  
  35. function progressTranslation(ndx)
  36. {
  37.     percent = ((new Date()).getTime() - animationContexts[ndx].animationStartTime)/animationContexts[ndx].animationDuration;
  38.     if (percent > 1.0)
  39.     {
  40.         percent = 1.0;
  41.         animationContexts[ndx].continueAnimation = false;
  42.     }
  43.     animationContexts[ndx].el.style.pixelLeft = animationContexts[ndx].startX*(1.0-percent) +  animationContexts[ndx].finalX*percent;
  44.     animationContexts[ndx].el.style.pixelTop = animationContexts[ndx].startY*(1.0-percent) +  animationContexts[ndx].finalY*percent;
  45. }
  46.  
  47. function finishTranslation(ndx)
  48. {
  49.     animationContexts[ndx].el.style.pixelLeft = parseInt(animationContexts[ndx].finalX);
  50.     animationContexts[ndx].el.style.pixelTop = parseInt(animationContexts[ndx].finalY);
  51. }
  52.  
  53. var animationContexts = new Array();
  54. var BSSCSequenceIndex = 0;
  55.  
  56.  
  57. function animationPump(ndx)
  58. {
  59.     animationContexts[ndx].progressAnimation(ndx);
  60.     if (animationContexts[ndx].continueAnimation)
  61.         animationContexts[ndx].tm = setTimeout("animationPump(" + ndx + ");", animationContexts[ndx].animationPeriod);
  62. }
  63.  
  64. function clearAnimations()
  65. {
  66.     for (index=0; index<animationContexts.length; index++)
  67.     {
  68.         animationContexts[index].finishAnimiation(index);
  69.         clearTimeout(animationContexts[index].tm);
  70.     }
  71.     animationContexts = new Array();
  72. }
  73.  
  74. function startNextAnimationSet()
  75. {
  76.     clearAnimations();
  77.     bStarted = false;
  78.     bFound = false
  79.  
  80.     // Determine the next sequence number
  81.     divElements = document.all.tags("DIV");
  82.     for (index = 0; index < divElements.length; index++)
  83.     {
  84.         el = divElements[index];
  85.         
  86.         objectOrder = el.getAttribute("BSSCObjectOrder", false);
  87.         if(null != objectOrder)
  88.         {
  89.             objectOrder = parseInt(objectOrder);
  90.             if (objectOrder > BSSCSequenceIndex && (!bFound || objectOrder < minBSSCSequenceIndexFound))
  91.             {
  92.                 minBSSCSequenceIndexFound = objectOrder;
  93.                 bFound = true;
  94.             }
  95.                 
  96.         }
  97.     }
  98.  
  99.     if (bFound)
  100.     {
  101.         BSSCSequenceIndex = minBSSCSequenceIndexFound;
  102.         bStarted = startAnimationSet(BSSCSequenceIndex);
  103.     }
  104. }
  105.  
  106. function getOffsetFromTopOfBrowser(el)
  107. {
  108.     if (null == el.offsetParent)
  109.         return el.offsetTop;
  110.     else
  111.         return el.offsetTop + getOffsetFromTopOfBrowser(el.offsetParent);
  112. }
  113.  
  114. function startAnimationSet(ndx)
  115. {
  116.     animationContextIndex = 0;
  117.     bStarted = false;
  118.  
  119.     // Find document elements with "BSSCAnimationType" attribute
  120.     divElements = document.all.tags("DIV");
  121.     for (index = 0; index < divElements.length; index++)
  122.     {
  123.         el = divElements[index];
  124.         
  125.         animationType = el.getAttribute("BSSCAnimationType", false);
  126.         if(null != animationType)
  127.         {
  128.             framePeriod = el.getAttribute("BSSCFramePeriod", false);
  129.             frameCount = el.getAttribute("BSSCFrameCount", false);
  130.             sequenceIndex = el.getAttribute("BSSCObjectOrder", false);
  131.  
  132.             // Stop any currently running RevealTrans filters
  133.             if ("RevealTrans" == animationType && parseInt(sequenceIndex) == ndx-1)
  134.                 el.filters.RevealTrans.stop();  
  135.  
  136.             // Filter on ndx
  137.             if (0 == ndx && null == sequenceIndex ||
  138.                 ndx == parseInt(sequenceIndex))
  139.             {
  140.                 if ("FlyInFromRight" == animationType)
  141.                 {
  142.                     animationDuration = el.getAttribute("BSSCDuration", false);
  143.                     if (null == animationDuration)
  144.                         animationDuration = 1000; // default to 1s
  145.                     animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  146.                     animationContexts[animationContextIndex].startX = document.body.clientWidth;
  147.                     animationContexts[animationContextIndex].startY = 0;
  148.                     animationContexts[animationContextIndex].finalX = 0;
  149.                     animationContexts[animationContextIndex].finalY = 0;
  150.                     animationPump(animationContextIndex++);
  151.                     bStarted = true;
  152.                 }
  153.  
  154.                 if ("FlyInFromLeft" == animationType)
  155.                 {
  156.                     animationDuration = el.getAttribute("BSSCDuration", false);
  157.                     if (null == animationDuration)
  158.                         animationDuration = 1000; // default to 1s
  159.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  160.                     {
  161.                         if ("left" == el.children[childIndex].style.textAlign)
  162.                             el.children[childIndex].style.textAlign = "right";
  163.                     }
  164.                     pixelsToTranslate = document.body.clientWidth;
  165.                     animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  166.                     animationContexts[animationContextIndex].startX = -document.body.clientWidth;
  167.                     animationContexts[animationContextIndex].startY = 0;
  168.                     animationContexts[animationContextIndex].finalX = 0;
  169.                     animationContexts[animationContextIndex].finalY = 0;
  170.                     animationPump(animationContextIndex++);
  171.                     bStarted = true;
  172.                 }
  173.                 
  174.                 if ("FlyInFromBottom" == animationType)
  175.                 {
  176.                     animationDuration = el.getAttribute("BSSCDuration", false);
  177.                     if (null == animationDuration)
  178.                         animationDuration = 1000; // default to 1s
  179.                     animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  180.                     animationContexts[animationContextIndex].startX = 0;
  181.                     animationContexts[animationContextIndex].startY = document.body.clientHeight - el.offsetTop;
  182.                     animationContexts[animationContextIndex].finalX = 0;
  183.                     animationContexts[animationContextIndex].finalY = 0;
  184.                     animationPump(animationContextIndex++);
  185.                     bStarted = true;
  186.                 }
  187.  
  188.                 if ("FlyInFromTop" == animationType)
  189.                 {
  190.                     animationDuration = el.getAttribute("BSSCDuration", false);
  191.                     if (null == animationDuration)
  192.                         animationDuration = 1000; // default to 1s
  193.                     animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  194.                     animationContexts[animationContextIndex].startX = 0;
  195.                     animationContexts[animationContextIndex].startY = -getOffsetFromTopOfBrowser(el) - el.offsetHeight;
  196.                     animationContexts[animationContextIndex].finalX = 0;
  197.                     animationContexts[animationContextIndex].finalY = 0;
  198.                     animationPump(animationContextIndex++);
  199.                     bStarted = true;
  200.                 }
  201.  
  202.  
  203.                 if ("FlyInFromBottomRight" == animationType)
  204.                 {
  205.                     animationDuration = el.getAttribute("BSSCDuration", false);
  206.                     if (null == animationDuration)
  207.                         animationDuration = 1000; // default to 1s
  208.                     pixelsToTranslate = document.body.clientWidth;
  209.                     if (document.body.clientHeight - el.offsetTop < pixelsToTranslate)
  210.                         pixelsToTranslate = document.body.clientHeight - el.offsetTop;
  211.                     animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  212.                     animationContexts[animationContextIndex].startX = pixelsToTranslate;
  213.                     animationContexts[animationContextIndex].startY = pixelsToTranslate;
  214.                     animationContexts[animationContextIndex].finalX = 0;
  215.                     animationContexts[animationContextIndex].finalY = 0;
  216.                     animationPump(animationContextIndex++);
  217.                     bStarted = true;
  218.                 }
  219.  
  220.                 if ("FlyInFromTopRight" == animationType)
  221.                 {
  222.                     animationDuration = el.getAttribute("BSSCDuration", false);
  223.                     if (null == animationDuration)
  224.                         animationDuration = 1000; // default to 1s
  225.                     pixelsToTranslate = document.body.clientWidth;
  226.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  227.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  228.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  229.                     animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  230.                     animationContexts[animationContextIndex].startX = pixelsToTranslate;
  231.                     animationContexts[animationContextIndex].startY = -pixelsToTranslate;
  232.                     animationContexts[animationContextIndex].finalX = 0;
  233.                     animationContexts[animationContextIndex].finalY = 0;
  234.                     animationPump(animationContextIndex++);
  235.                     bStarted = true;
  236.                 }
  237.  
  238.                 if ("FlyInFromTopLeft" == animationType)
  239.                 {
  240.                     animationDuration = el.getAttribute("BSSCDuration", false);
  241.                     if (null == animationDuration)
  242.                         animationDuration = 1000; // default to 1s
  243.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  244.                     {
  245.                         if ("left" == el.children[childIndex].style.textAlign)
  246.                             el.children[childIndex].style.textAlign = "right";
  247.                     }
  248.                     pixelsToTranslate = document.body.clientWidth;
  249.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  250.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  251.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  252.                     animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  253.                     animationContexts[animationContextIndex].startX = -pixelsToTranslate;
  254.                     animationContexts[animationContextIndex].startY = -pixelsToTranslate;
  255.                     animationContexts[animationContextIndex].finalX = 0;
  256.                     animationContexts[animationContextIndex].finalY = 0;
  257.                     animationPump(animationContextIndex++);
  258.                     bStarted = true;
  259.                 }
  260.  
  261.                 if ("FlyInFromBottomLeft" == animationType)
  262.                 {
  263.                     animationDuration = el.getAttribute("BSSCDuration", false);
  264.                     if (null == animationDuration)
  265.                         animationDuration = 1000; // default to 1s
  266.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  267.                     {
  268.                         if ("left" == el.children[childIndex].style.textAlign)
  269.                             el.children[childIndex].style.textAlign = "right";
  270.                     }
  271.                     pixelsToTranslate = document.body.clientWidth;
  272.                     if (document.body.clientHeight - el.offsetTop < pixelsToTranslate)
  273.                         pixelsToTranslate = document.body.clientHeight - el.offsetTop;
  274.                     animationContexts[animationContextIndex] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  275.                     animationContexts[animationContextIndex].startX = -pixelsToTranslate;
  276.                     animationContexts[animationContextIndex].startY = pixelsToTranslate;
  277.                     animationContexts[animationContextIndex].finalX = 0;
  278.                     animationContexts[animationContextIndex].finalY = 0;
  279.                     animationPump(animationContextIndex++);
  280.                     bStarted = true;
  281.                 }
  282.                                 
  283.                 if ("FadeIn" == animationType)
  284.                 {
  285.                     animationDuration = el.getAttribute("BSSCDuration", false);
  286.                     if (null == animationDuration)
  287.                         animationDuration = 1000; // default to 1s
  288.                     
  289.                     finalOpacity = el.getAttribute("BSSCFinalOpacity", false);
  290.                     if (null == finalOpacity)
  291.                         finalOpacity = 100;
  292.                     
  293.                     initialOpacity = el.getAttribute("BSSCInitialOpacity", false);
  294.                     if (null == initialOpacity)
  295.                         initialOpacity = 0;
  296.  
  297.                     animationContexts[animationContextIndex] = new animationContext(el, progressFade, finishFade, animationDuration, 50);
  298.                     el.filters.opacity = initialOpacity;
  299.                     animationContexts[animationContextIndex].initialOpacity = initialOpacity;
  300.                     animationContexts[animationContextIndex].finalOpacity = finalOpacity;
  301.                     animationPump(animationContextIndex++);
  302.                     bStarted = true;
  303.                 }
  304.                 
  305.                 if ("RevealTrans" == animationType)
  306.                 {
  307.                     Duration = el.getAttribute("BSSCDuration", false);
  308.                     if (null == Duration)
  309.                         Duration = 1000; // default to 1s
  310.                     Transition = el.getAttribute("BSSCTransition", false);
  311.                     if (null == Transition)
  312.                         Transition = 0;
  313.                     el.style.filter = "RevealTrans();";
  314.                     el.filters.RevealTrans.Transition = Transition;
  315.                     el.filters.RevealTrans.apply();
  316.                     el.style.visibility = ""; 
  317.                     el.filters.RevealTrans.play(parseInt(Duration)/1000.0);  
  318.                     bStarted = true;
  319.                 }
  320.             }
  321.         }
  322.     }
  323.     return bStarted;
  324. }
  325.  
  326. function ApplyTextFormatting(divEl, childEl)
  327. {
  328.     childEl.setAttribute("BSSCOriginalStyle", childEl.style);
  329.  
  330.     // Text Change
  331.     hoverColor = divEl.getAttribute("BSSCHoverColor", false);
  332.     if ("Default" != divEl.getAttribute("BSSCHoverColorName"))
  333.     {
  334.         childEl.setAttribute("BSSCOriginalColor", childEl.style.color);
  335.         childEl.style.color = hoverColor;
  336.     }
  337.  
  338.     hoverFontName = divEl.getAttribute("BSSCHoverFontName", false);
  339.     if (null != hoverFontName && hoverFontName != "*Default*")
  340.     {
  341.         hoverFontFamily = divEl.getAttribute("BSSCHoverFontFamily", false);
  342.         if (null != hoverFontFamily)
  343.         {
  344.             childEl.setAttribute("BSSCOriginalFontFamily", childEl.style.fontFamily);
  345.             childEl.style.fontFamily = hoverFontFamily;
  346.         }
  347.     }
  348.  
  349.     hoverFontSize = divEl.getAttribute("BSSCHoverFontSize", false);
  350.     {
  351.         if (null != hoverFontSize && hoverFontSize != "*")
  352.         {
  353.             childEl.setAttribute("BSSCOriginalFontSize", childEl.style.fontSize);
  354.             childEl.style.fontSize = hoverFontSize + "pt";
  355.         }
  356.     }
  357.  
  358.     hoverFontStyle = divEl.getAttribute("BSSCHoverFontStyle", false);
  359.     if (null != hoverFontStyle && "Regular" != hoverFontStyle)
  360.     {
  361.         if ("Italic" == hoverFontStyle)
  362.         {
  363.             childEl.setAttribute("BSSCOriginalFontStyle", childEl.style.fontStyle);
  364.             childEl.style.fontStyle = "italic";
  365.         }
  366.         else if ("Bold" == hoverFontStyle)
  367.         {
  368.             childEl.setAttribute("BSSCOriginalFontWeight", childEl.style.fontWeight);
  369.             childEl.style.fontWeight = "bold";
  370.         }
  371.         else if ("Bold Italic" == hoverFontStyle)
  372.         {
  373.             childEl.setAttribute("BSSCOriginalFontStyle", childEl.style.fontStyle);
  374.             childEl.style.fontStyle = "italic";
  375.             childEl.setAttribute("BSSCOriginalFontWeight", childEl.style.fontWeight);
  376.             childEl.style.fontWeight = "bold";
  377.         }
  378.     }
  379.  
  380.     hoverUnderline = divEl.getAttribute("BSSCHoverUnderLine", false);
  381.     if (null != hoverUnderline && hoverUnderline == "TRUE")
  382.     {
  383.         childEl.setAttribute("BSSCOriginalTextDecoration", childEl.style.textDecoration);
  384.         childEl.style.textDecoration = "underline";
  385.     }
  386. }
  387.  
  388. function RemoveTextFormatting(el)
  389. {
  390.     originalColor = el.getAttribute("BSSCOriginalColor", false);
  391.     if (null != originalColor)
  392.         el.style.color = originalColor;
  393.  
  394.     originalFontFamily = el.getAttribute("BSSCOriginalFontFamily", false);
  395.     if (null != originalFontFamily)
  396.         el.style.fontFamily = originalFontFamily;
  397.  
  398.     originalFontSize = el.getAttribute("BSSCOriginalFontSize", false);
  399.     if (null != originalFontSize)
  400.         el.style.fontSize = originalFontSize;
  401.  
  402.     originalFontStyle = el.getAttribute("BSSCOriginalFontStyle", false);
  403.     if (null != originalFontStyle)
  404.         el.style.fontStyle = originalFontStyle;
  405.  
  406.     originalFontWeight = el.getAttribute("BSSCOriginalFontWeight", false);
  407.     if (null != originalFontWeight)
  408.         el.style.fontWeight = originalFontWeight;
  409.  
  410.     originalTextDecoration = el.getAttribute("BSSCOriginalTextDecoration", false);
  411.     if (null != originalTextDecoration)
  412.         el.style.textDecoration = originalTextDecoration;
  413. }
  414.  
  415. function BSSCOnMouseOver(el)
  416. {
  417.     // Text Formatting
  418.     hoverColor = el.getAttribute("BSSCHoverColor", false);
  419.     if (null != hoverColor)
  420.         for (index=0; index<el.all.length; index++)
  421.             ApplyTextFormatting(el, el.all[index]);
  422.  
  423.     // Glow
  424.     glowColor = el.getAttribute("BSSCGlowColor", false);
  425.     if (null != glowColor)
  426.     {
  427.         glowStrength = el.getAttribute("BSSCGlowStrength", false);
  428.         if (null == glowStrength)
  429.             glowStrength = "3";
  430.         glowColorName = el.getAttribute("BSSCGlowColorName");
  431.         if ("Default" == glowColorName)
  432.             el.style.filter = "glow(Strength=" + glowStrength + ", enabled=1)";
  433.         else
  434.             el.style.filter = "glow(Color=#" + glowColor + ", Strength=" + glowStrength + ", enabled=1)";
  435.     }
  436. }
  437.  
  438. function BSSCOnMouseOut(el)
  439. {
  440.     // Text Formatting
  441.     hoverColor = el.getAttribute("BSSCHoverColor", false);
  442.     if (null != hoverColor)
  443.         for (index=0; index<el.all.length; index++)
  444.             RemoveTextFormatting(el.all[index]);
  445.  
  446.     // Glow
  447.     glowColor = el.getAttribute("BSSCGlowColor", false);
  448.     if (null != glowColor)
  449.         el.style.filter="";
  450.  
  451. }
  452.  
  453. function IsIE4OrLater()
  454. {
  455.     if ("Microsoft Internet Explorer" != navigator.appName)
  456.         return false;
  457.     version = parseFloat(navigator.appVersion);
  458.     if (version >= 4.0)
  459.         return true;
  460.     else
  461.         return false;
  462. }
  463.  
  464. function BSSCOnLoad()
  465. {
  466.     if (!IsIE4OrLater())
  467.         return;
  468.     doStaticEffects();
  469.     startAnimationSet(0);
  470. }
  471.  
  472. function BSSCOnClick()
  473. {
  474.     if (!IsIE4OrLater())
  475.         return;
  476.     startNextAnimationSet();
  477. }
  478.  
  479. function doStaticEffects()
  480. {
  481.     divElements = document.all.tags("DIV");
  482.     for (index = 0; index < divElements.length; index++)
  483.     {
  484.         el = divElements[index];
  485.         
  486.         dropShadowColor = el.getAttribute("BSSCDropShadowColor");
  487.         if (null != dropShadowColor)
  488.         {
  489.             dropShadowXOffset = el.getAttribute("BSSCDropShadowXOffset");
  490.             if (null == dropShadowXOffset)
  491.                 dropShadowXOffset = 0;
  492.             dropShadowYOffset = el.getAttribute("BSSCDropShadowYOffset");
  493.             if (null == dropShadowYOffset)
  494.                 dropShadowYOffset = 0;
  495.             dropShadowColorName = el.getAttribute("BSSCDropShadowColorName");
  496.             if ("Default" == dropShadowColorName)
  497.                 el.style.filter = "DropShadow(OffX=" + dropShadowXOffset + ", OffY=" + dropShadowYOffset + ")";
  498.             else
  499.                 el.style.filter = "DropShadow(Color=" + dropShadowColor + ", OffX=" + dropShadowXOffset + ", OffY=" + dropShadowYOffset + ")";
  500.         }
  501.     }
  502. }
  503.  
  504. function drop( targetId ){ 
  505.        target = document.all( targetId );
  506.        if (target.style.display == 'none') {
  507.            target.style.display = "" ;
  508.        } else {
  509.            target.style.display = "none";
  510.        }
  511. }
  512.  
  513. function checkParent(src,dest)
  514. {
  515.     //Search for a specific parent of the current element.
  516.     while(src !=null)
  517.     {
  518.         if(src.tagName == dest)
  519.         {
  520.             return src;
  521.         }
  522.         src = src.parentElement;
  523.     }
  524.     return null;
  525. }
  526.  
  527. //Generic Display code
  528. function outline2()
  529. {
  530.     //Expand or collapse if a list item is clicked.
  531.     var open = event.srcElement;
  532.  
  533.     //Verify that the tag which was clicked was either the 
  534.     //trigger tag or nested within a trigger tag.
  535.     var el = checkParent(open,"CITE");
  536.     if(null != el)
  537.     {    
  538.         var incr=0;
  539.         var elmPos = 0;
  540.         var parentSpan;
  541.         var fBreak
  542.  
  543.         //Get the position of the element which was clicked
  544.         elemPos = window.event.srcElement.sourceIndex;
  545.  
  546.         //Search for a SPAN tag
  547.         for (parentSpan = window.event.srcElement.parentElement;
  548.             parentSpan!=null;
  549.             parentSpan = parentSpan.parentElement) 
  550.         {
  551.             //test if already at a span tag 
  552.             if (parentSpan.tagName=="SPAN") 
  553.             {
  554.                 incr=1;
  555.                 break;
  556.             }
  557.             
  558.             //Test if the tag clicked was in a body tag or in any of the possible kinds of lists
  559.             //we perform this test because nested lists require special handling
  560.             if (parentSpan.tagName=="BODY" || parentSpan.tagName=="UL" || parentSpan.tagName=="OL") 
  561.             {
  562.                 //Determine where the span to be expanded is.  
  563.                 for (incr=1; (elemPos+incr) < document.all.length; incr++)
  564.                 {    
  565.                     //verify we are at an expandable Div tag
  566.                     if(document.all(elemPos+incr).tagName=="SPAN" && 
  567.                     (document.all(elemPos+incr).className=="expanded" ||
  568.                      document.all(elemPos+incr).className=="collapsed"))
  569.                     {
  570.                         fBreak=1;
  571.                         break;
  572.                     }
  573.                     //If the next tag following the list item (li) is another 
  574.                     //list item(li) return in order to prevent accidentally opening
  575.                     //the next span in the list
  576.                     else if(document.all(elemPos+incr).tagName=="LI")
  577.                     {
  578.                         return;
  579.                     }
  580.                 }
  581.             }
  582.             //determine if we need to break out of the while loop (kind of a kludge since theres no goto in javascript)
  583.             if(fBreak==1)
  584.             {
  585.                 break;
  586.             }
  587.         }
  588.  
  589.     }
  590.     else
  591.     {
  592.         return;
  593.     }
  594.  
  595.     //Now that we've identified the span, expand or collapse it
  596.     if(document.all(elemPos+incr) == null)
  597.     {
  598.         return;
  599.     }
  600.     else if(document.all(elemPos+incr).className=="collapsed")
  601.     {
  602.         document.all(elemPos+incr).className="expanded";
  603.     }
  604.     else if(document.all(elemPos+incr).className=="expanded")
  605.     {
  606.         document.all(elemPos+incr).className="collapsed";
  607.     }
  608.     else
  609.     {
  610.         return;
  611.     }
  612.     event.cancelBubble = true;
  613. }
  614.