home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2001 September / MICD2001_09_NR1.iso / Www / @t / dane / menu_info.js < prev    next >
Text File  |  2001-07-28  |  17KB  |  706 lines

  1. // WSZELKIE PRAWA ZASTRZEZONE ! KOPIOWANIE KODU W CALOSCI BADZ FRAGMENTACH ZABRONIONE! \\
  2.  
  3.  
  4. lev0 = new Array ("xx-small","1",true,false,"white","black","White","Verdana","gray") ;
  5. lev1 = new Array ("xx-small","1",true,false,"white","black","White","Verdana","#669966") ;
  6. lev2 = new Array ("xx-small","1",true,false,"white","black","White","Verdana","#669966") ;
  7. lev3 = new Array ("xx-small","1",true,false,"white","black","White","Verdana","#669966") ;
  8. lev4 = new Array ("xx-small","1",true,false,"white","black","White","Verdana","#669966") ;
  9. lev5 = new Array ("xx-small","1",true,false,"white","black","White","Verdana","#669966") ;
  10.  
  11.  
  12.  
  13. mn1 = new Array
  14. (
  15. "<font color=\"yellow\">Ten skrypt nie dzia│a we wstΩpniaku oraz w spisie tre╢ci</font>","",0
  16. )
  17.  
  18.  
  19. imgStr = "<IMG SRC=\'st.gif\' BORDER=0 WIDTH=16 HEIGHT=16 ALIGN=RIGHT>" ;
  20. if (isFrames)
  21.     {
  22.     if (NS4)
  23.         loader = parent ;
  24.       else
  25.         loader = parent.document.body ;
  26.     }
  27.   else
  28.     loader = window ;
  29. loader.onload = beg ;
  30. stStr = new Array ('\\','|','/','-'+'-')
  31. stPos = 0 ;
  32. areCreated = false ;
  33. menuLoc = null ;
  34. trgLoc = null ;
  35. topCount = 1 ;
  36. beingCreated = false ;
  37. isOverMenu = false ;
  38. currentMenu = null ;
  39. oldLinkEl = null ;
  40.  
  41. function beg ()
  42.     {
  43.     if (isFrames)
  44.         {
  45.         menuLoc = eval("parent.frames." + mainFrName) ;
  46.         trgLoc = eval("parent.frames." + trgFrName) ;
  47.         }
  48.       else
  49.         {
  50.         menuLoc = window ;
  51.         trgLoc = window ;
  52.         }
  53.     if (NS4)
  54.         {
  55.         menuLoc.document.captureEvents(Event.MOUSEDOWN) ;
  56.         menuLoc.document.onmousedown = clicked ;
  57.         }
  58.     if (IE4)
  59.         {
  60.         if (mout)
  61.             menuLoc.document.onmouseover = clicked ;
  62.           else
  63.             menuLoc.document.onmousedown = clicked ;
  64.         }
  65.     beingCreated = true ;
  66.     while( eval ("window.mn" + topCount))
  67.         {
  68.         if (NS4)
  69.             createMnNS(0,false,topCount)
  70.           else
  71.             createMnIE(0,false,topCount) ;
  72.         topCount++
  73.         }
  74.     status = "" ;
  75.     areCreated = true ;
  76.     beingCreated = false ;
  77.     }
  78.  
  79. function createMnNS (lev,isChild,menuCount,parMenu,parItem)
  80.     {
  81.     tempArray = eval("mn" + menuCount) ;
  82.     
  83.     if (!isChild)
  84.         {
  85.         menu = createEl("elMenu" + menuCount,menuWidth,null,null) ;
  86.         }
  87.       else
  88.         {
  89.         menu = createEl("elMenu" + menuCount,null,parMenu,null) ;
  90.         }
  91.     menu.lev = lev ;
  92.     menu.array = tempArray ;
  93.     menu.setMenuTree = setMenuTree ;
  94.     menu.setMenuTree(isChild,parMenu) ;
  95.  
  96.     while (menu.itemCount < menu.maxItems)
  97.         {
  98.         menu.itemCount++ ;
  99.         if (++stPos == stStr.length)
  100.             stPos = 0 ;
  101.         status = "úadowanie... " + stStr [stPos] ;
  102.         prevItem = (menu.itemCount > 1) ? menu.item : null ;
  103.         itemName = "item" + menuCount + "_" + menu.itemCount ;
  104.  
  105.         menu.item = createEl (itemName,null,null,menu) ;
  106.  
  107.         menu.item.prevItem = prevItem ;
  108.         menu.item.setup = createIt ;
  109.         menu.item.setup (menu.itemCount,menu.array) ;
  110.         if (menu.item.hasMore)
  111.             {
  112.             createMnNS (lev+1,true,menuCount + "_" + menu.itemCount,menu,menu.item) ;
  113.             menu = menu.parentMenu ;
  114.             }
  115.         }
  116.  
  117.     menu.lastItem = menu.item ;
  118.     menu.setup (isChild,parMenu,parItem) ;
  119.     }
  120.  
  121. function createMnIE (lev,isChild,menuCount,parMenu)
  122.     {
  123.     menu = createEl ("elMenu" + menuCount) ;
  124.     menu.array = eval ("mn" + menuCount) ;
  125.     menu.lev = lev ;
  126.     menu.setMenuTree = setMenuTree ;
  127.     menu.setMenuTree(isChild,parMenu) ;
  128.     menu.itemStr = "" ;
  129.     while (menu.itemCount < menu.maxItems)
  130.         {
  131.         menu.itemCount++ ;
  132.         if (++stPos == stStr.length)
  133.             stPos = 0 ;
  134.         status = "úadowanie... " + stStr [stPos] ;
  135.         itemName = "item" + menuCount + "_" + menu.itemCount ;
  136.         arrayPointer = (menu.itemCount-1) * 3 ;
  137.         dispText = menu.array [arrayPointer] ;
  138.         hasMore = menu.array [arrayPointer + 2] ;
  139.         htmStr = (hasMore) ? imgStr + dispText : dispText ;
  140.         menu.itemStr += "<SPAN ID=" + itemName + " STYLE=\"width:" + menu.menuWidth + "\">" + htmStr + "</SPAN><BR>" ;
  141.         if (hasMore)
  142.             {
  143.             createMnIE (lev+1,true,menuCount + "_" + menu.itemCount,menu) ;
  144.             menu = menu.parentMenu ;
  145.             }    
  146.         }
  147.  
  148.     menu.innerHTML = menu.itemStr ;
  149.     itemColl = menu.children.tags("SPAN") ;
  150.     for (i = 0 ; i < itemColl.length ; i++)
  151.         {
  152.         it = itemColl(i) ;
  153.         it.setup = createIt ;
  154.         it.setup(i+1,menu.array) ;
  155.         }
  156.     menu.lastItem = itemColl (itemColl.length - 1) ;
  157.     menu.setup (isChild,parMenu) ;
  158.     }
  159.  
  160. function createIt (theItem,theArray)
  161.     {
  162.     this.onmouseover = itemOver ;
  163.     this.onmouseout = itemOut ;
  164.     if (NS4)
  165.         this.container = this.parentLayer ;
  166.       else
  167.         this.container = this.offsetParent ;
  168.     arrayPointer = (theItem - 1) * 3 ;
  169.     this.dispText = theArray [arrayPointer] ;
  170.     this.linkText = theArray [arrayPointer + 1] ;
  171.     this.hasMore = theArray [arrayPointer + 2] ;
  172.  
  173.     if (IE4 && this.hasMore)
  174.         {
  175.         stInd = this.id.indexOf ("m") ;
  176.         this.child = eval ("elMenu" + this.id.substr(stInd + 1)) ;
  177.         this.child.parentMenu = this.container ;
  178.         this.child.parentItem = this ;
  179.         }
  180.     if (this.linkText)
  181.         {
  182.         if (NS4)
  183.             {
  184.             this.captureEvents (Event.CLICK) ;
  185.             this.onclick = linkIt ;
  186.             }
  187.         else
  188.             {
  189.             this.onclick = linkIt ;
  190.             this.style.cursor = "hand" ;
  191.             }
  192.         }
  193.     if (this.container.lev > maxlev)
  194.         levArr = eval ("lev" + maxlev) ;
  195.       else
  196.         levArr = eval ("lev" + this.container.lev) ;
  197.     fntSizNS = levArr [1] ;
  198.     fntSizIE = levArr [0] ;
  199.     fntBold = levArr [2] ;
  200.     fntItal = levArr [3] ;
  201.     fntFam = levArr [7] ;
  202.     if (NS4)
  203.         {
  204.         htmStr = this.dispText ;
  205.          this.document.tags.A.textDecoration = "none" ;
  206.         if (fntBold)
  207.             htmStr = htmStr.bold () ;
  208.         if (fntItal)
  209.             htmStr = htmStr.italics () ;
  210.         htmStr = "<FONT FACE=\"" + fntFam + "\" SIZE=" + fntSizNS + ">" + htmStr+ "</FONT>" ;
  211.         if (this.linkText)
  212.             {
  213.             with (this.document)
  214.                 {
  215.                 linkColor = this.container.menuFontColor ;
  216.                 alinkColor = this.container.menuFontColor ;
  217.                 vlinkColor = this.container.menuFontColor ;
  218.                 }
  219.             htmStrOver = htmStr.fontcolor (this.container.menuFontOver).link("javascript:void(0)") ;
  220.             htmStr = htmStr.link ("javascript:void(0)") ;
  221.             }
  222.           else
  223.             {
  224.             htmStrOver = htmStr.fontcolor (this.container.menuFontOver) ;
  225.             htmStr = htmStr.fontcolor (this.container.menuFontColor) ;
  226.             }
  227.         this.htmStr = (this.hasMore) ? imgStr + htmStr : htmStr ;
  228.         this.htmStrOver = (this.hasMore) ? (imgStr + htmStrOver) : htmStrOver ;
  229.         this.document.write (this.htmStr) ;
  230.         this.document.close () ;
  231.         this.visibility = "inherit" ;
  232.         this.bgColor = this.container.menuBGColor ;
  233.  
  234.         if (theItem == 1)
  235.             this.top = borWid + itemPad;
  236.           else
  237.             this.top = this.prevItem.top + this.prevItem.clip.height + sep ;
  238.  
  239.         this.left = borWid + itemPad ;
  240.         this.clip.top = this.clip.left = -itemPad ;
  241.         this.clip.bottom += itemPad ;
  242.         this.clip.right = this.container.menuWidth - (borWid * 2) - itemPad ;
  243.         }
  244.       else
  245.         {
  246.         with (this.style)
  247.             {
  248.             padding = itemPad ;
  249.             color = this.container.menuFontColor ;
  250.             fontSize = fntSizIE ;
  251.             fontWeight = (fntBold) ? "bold" : "normal" ;
  252.             fontStyle =    (fntItal) ? "italic" : "normal" ;
  253.             fontFamily = fntFam ;
  254.             borderBottomWidth = sep + "px" ;
  255.             borderBottomColor = "black" ;
  256.             borderBottomStyle = "solid" ;
  257.             backgroundColor = this.container.menuBGColor ;
  258.             }
  259.         }
  260.     }    
  261.  
  262. function createEl (theEl,theWidth,theParent,theContainer)
  263.     {
  264.     if (NS4)
  265.         {
  266.         if (theWidth)
  267.             elWidth = theWidth ;
  268.           else
  269.             {
  270.             elWidth = (theContainer) ? theContainer.menuWidth : theParent.menuWidth ;
  271.             if (theContainer)
  272.                 elWidth = elWidth - (borWid * 2) - (itemPad * 2) ;
  273.             }
  274.  
  275.         if (!theContainer)
  276.             theContainer = menuLoc;
  277.         eval(theEl + "= new Layer(elWidth,theContainer)") ;
  278.         }
  279.       else
  280.         {
  281.         elStr = "<DIV ID=" + theEl + " STYLE='position:absolute'></DIV>" ;
  282.         menuLoc.document.body.insertAdjacentHTML("BeforeEnd",elStr) ;
  283.         }
  284.     return eval (theEl) ;
  285.     }
  286.  
  287. function setMenuTree (isChild,parMenu)
  288.     {
  289.     if (this.lev > maxlev)
  290.         levArr = eval ("lev" + maxlev) ;
  291.       else
  292.         levArr = eval ("lev" + this.lev) ;
  293.     this.menuWidth = menuWidth ;
  294.     this.menuFontColor = levArr [4] ;
  295.     this.menuFontOver = levArr [6] ;
  296.     this.menuBGColor = levArr [5] ;
  297.     this.menuBGOver = levArr [8] ;
  298.     this.menuBorCol = borderCol ;
  299.     if (!isChild)
  300.         {
  301.         this.treeParent = this ;
  302.         this.startChild = this ;
  303.         }
  304.       else
  305.         {
  306.         this.treeParent = parMenu.treeParent ;
  307.         }
  308.  
  309.     this.maxItems = this.array.length/3 ;
  310.     this.hasParent = isChild ;
  311.     this.setup = menuSetup ;
  312.     this.itemCount = 0 ;
  313.     }
  314.  
  315. function ensureVis ()
  316.     {
  317.     if (NS4)
  318.         {
  319.         winRight = menuLoc.pageXOffset + menuLoc.innerWidth ;
  320.         rightPos = this.left + this.menuWidth ;
  321.         if (rightPos > winRight)
  322.             {
  323.             if (this.hasParent)
  324.                 {
  325.                 parentLeft = this.parentMenu.left ;
  326.                 newLeft = ((parentLeft-this.menuWidth) + this.childOverlap) ;
  327.                 this.left = newLeft ;
  328.                 }
  329.               else
  330.                 {
  331.                 dif = rightPos - winRight ;
  332.                 this.left -= dif ;
  333.                 }
  334.             }
  335.         winBot = menuLoc.pageYOffset + menuLoc.innerHeight ;
  336.         botPos = this.top + this.fullHeight ;
  337.         if (botPos > winBot)
  338.             {
  339.             dif = botPos - winBot ;
  340.             this.top -= dif ;
  341.             }
  342.         winLeft = menuLoc.pageXOffset ;
  343.         leftPos = this.left ;
  344.         if (leftPos < winLeft)
  345.             {
  346.             if (this.hasParent)
  347.                 {
  348.                 parentLeft = this.parentMenu.left ;
  349.                 newLeft = ((parentLeft+this.menuWidth) - this.childOverlap) ;
  350.                 this.left = newLeft ;
  351.                 }
  352.               else
  353.                 this.left = 5 ;
  354.             }
  355.         }
  356.       else
  357.         {
  358.             winRight = menuLoc.document.body.scrollLeft + menuLoc.document.body.clientWidth ;
  359.         rightPos = this.style.pixelLeft + this.menuWidth ;
  360.         if (rightPos > winRight)
  361.             {
  362.             if (this.hasParent)
  363.                 {
  364.                 parentLeft = this.parentMenu.style.pixelLeft ;
  365.                 newLeft = ((parentLeft - this.menuWidth) + this.childOverlap) ;
  366.                 this.style.pixelLeft = newLeft ;
  367.                 }
  368.               else
  369.                 {
  370.                 dif = rightPos - winRight ;
  371.                 this.style.pixelLeft -= dif ;
  372.                 }
  373.             }
  374.         winBot = menuLoc.document.body.scrollTop + menuLoc.document.body.clientHeight ;
  375.         botPos = this.style.pixelTop + this.fullHeight ;
  376.         if (botPos > winBot)
  377.             {
  378.             dif = botPos - winBot ;
  379.             this.style.pixelTop -= dif ;
  380.             }
  381.         winLeft = menuLoc.document.body.scrollLeft ;
  382.         leftPos = this.style.pixelLeft ;
  383.         if (leftPos < winLeft)
  384.             {
  385.             if (this.hasParent)
  386.                 {
  387.                 parentLeft = this.parentMenu.style.pixelLeft ;
  388.                 newLeft = ((parentLeft+this.menuWidth) - this.childOverlap) ;
  389.                 this.style.pixelLeft = newLeft ;
  390.                 }
  391.               else
  392.                 this.style.pixelLeft = 5 ;
  393.             }
  394.         }
  395.     }
  396.  
  397. function menuSetup (hasParent,openCont,openItem)
  398.     {
  399.     this.onmouseover = menuOver ;
  400.     this.onmouseout = menuOut ;
  401.     this.showIt = showIt ;
  402.     this.ensureVis = ensureVis ;
  403.     this.hideTree = hideTree ;
  404.     this.hideParents = hideParents ;
  405.     this.hideChildren = hideChildren ;
  406.     this.hideTop = hideTop ;
  407.     this.hasChildVisible = false ;
  408.     this.isOn = false ;
  409.     this.childOverlap = childOverlap ;
  410.     this.currentItem = null ;
  411.     this.hideSelf = hideSelf ;
  412.         
  413.     if (hasParent)
  414.         {
  415.         this.hasParent = true ;
  416.         this.parentMenu = openCont ;
  417.         if (NS4)
  418.             {
  419.             this.parentItem = openItem ;
  420.             this.parentItem.child = this ;
  421.             }
  422.         }
  423.       else
  424.         this.hasParent = false ;
  425.  
  426.     if (NS4)
  427.         {
  428.         this.bgColor = this.menuBorCol ;
  429.         this.fullHeight = this.lastItem.top + this.lastItem.clip.bottom + borWid ;
  430.         this.clip.right = this.menuWidth ;
  431.         this.clip.bottom = this.fullHeight ;
  432.         }
  433.       else
  434.         {
  435.         with (this.style)
  436.             {
  437.             width = this.menuWidth ;
  438.             borderWidth = borWid ;
  439.             borderColor = this.menuBorCol ;
  440.             borderStyle = "solid" ;
  441.             }
  442.         this.lastItem.style.border = "" ;
  443.         this.fullHeight = this.scrollHeight ;
  444.         this.showIt (false) ;
  445.         this.onselectstart = cancelSelect ;
  446.         this.moveTo = moveTo ;
  447.         this.moveTo (0,0) ;        
  448.         }
  449.     }
  450.  
  451. function menuOver ()
  452.     {
  453.     this.isOn = true ;
  454.     isOverMenu = true ;
  455.     currentMenu = this ;
  456.     }
  457.  
  458. function menuOut ()
  459.     {
  460.     if (IE4)
  461.         {
  462.         theEvent = menuLoc.event ;
  463.         if (theEvent.srcElement.contains (theEvent.toElement))
  464.             return ;
  465.         }
  466.     this.isOn = false ;
  467.     isOverMenu = false ;
  468.     }
  469.  
  470. function popMenu (e)
  471.     {
  472.     if (!areCreated)
  473.         return true;
  474.     eType = (NS4) ? e.type : event.type ;
  475.     hideAll () ;
  476.     linkEl = (NS4) ? e.target : event.srcElement ;
  477.     currentMenu = eval(linkEl.menuName) ;
  478.     currentMenu.hasParent = false ;
  479.     currentMenu.treeParent.startChild = currentMenu ;
  480.     if (IE4)
  481.         {
  482.         menuLocBod = menuLoc.document.body ;
  483.         se = event.srcElement ;
  484.         xPos = se.offsetLeft ;
  485.         yPos = se.offsetTop ;
  486.         if (menuHorizontal)
  487.             yPos += se.offsetHeight ;
  488.           else
  489.             xPos += se.offsetWidth + (mout ? 0 : 6) ;
  490.         while (se.offsetParent)
  491.             {
  492.             if (se.offsetParent == se || se.offsetParent == document.body)
  493.                 break ;
  494.             xPos += se.offsetParent.offsetLeft ;
  495.             yPos += se.offsetParent.offsetTop ;
  496.             se = se.offsetParent ;
  497.             }
  498.         }
  499.     else
  500.         {
  501.         xPos = e.pageX ;
  502.         yPos = e.pageY ;
  503.         if (menuHorizontal)
  504.             yPos += 6 ;
  505.           else
  506.             xPos += 20 ;
  507.         }
  508.     currentMenu.moveTo (xPos,yPos) ;
  509.     currentMenu.ensureVis () ;
  510.     currentMenu.isOn = true ;
  511.     currentMenu.showIt (true) ;
  512.     return false ;
  513.     }
  514.  
  515. function popUp (menuName,e)
  516.     {
  517.     if (!areCreated)
  518.         return ;
  519.     linkEl = (NS4) ? e.target : event.srcElement ;
  520.     if (linkEl != oldLinkEl)
  521.         oldLinkEl = linkEl ;
  522.       else
  523.         return ;
  524.     if (!beingCreated && !areCreated)
  525.         beg () ;
  526.     linkEl.menuName = menuName ;
  527.     popMenu (e) ;
  528.     }
  529.  
  530. function itemOut ()
  531.     {
  532.     if (IE4)
  533.         {
  534.         theEvent = menuLoc.event ;
  535.             if (theEvent.srcElement.contains(theEvent.toElement) || (theEvent.fromElement.tagName=="IMG" && theEvent.toElement.contains(theEvent.fromElement)))
  536.             return;
  537.         this.style.backgroundColor = this.container.menuBGColor ;
  538.         this.style.color = this.container.menuFontColor ;
  539.         }
  540.       else
  541.         {
  542.         this.bgColor = this.container.menuBGColor ;
  543.         with (this.document)
  544.             {
  545.             linkColor = this.container.menuFontColor ;
  546.             write (this.htmStr) ;
  547.             close () ;
  548.             }
  549.         }
  550.     }
  551.  
  552. function itemOver ()
  553.     {
  554.     if (IE4)
  555.         {
  556.         theEvent = menuLoc.event ;
  557.         if (theEvent.srcElement.tagName == "IMG")
  558.             return ;
  559.         this.style.backgroundColor = this.container.menuBGOver ;
  560.         this.style.color = this.container.menuFontOver ;
  561.         }
  562.       else
  563.         {
  564.         this.bgColor = this.container.menuBGOver ;
  565.         this.document.write (this.htmStrOver) ;
  566.         this.document.close () ;
  567.         }
  568.     this.container.currentItem = this ;
  569.     if (this.container.hasChildVisible)
  570.         this.container.hideChildren (this) ;
  571.     if (this.hasMore)
  572.         {
  573.         horOffset = this.container.menuWidth - this.container.childOverlap ;
  574.         if (NS4)
  575.             {
  576.             this.childX = this.container.left + horOffset ;
  577.             this.childY = this.pageY + 6 ;
  578.             }
  579.           else
  580.             {
  581.             this.childX = this.container.style.pixelLeft + horOffset ;
  582.             this.childY = this.offsetTop + this.container.style.pixelTop + 6 ;
  583.             }
  584.         this.child.moveTo (this.childX,this.childY) ;
  585.         this.child.ensureVis () ;
  586.         this.container.hasChildVisible = true ;
  587.         this.container.visibleChild = this.child ;
  588.         this.child.showIt (true) ;
  589.         }
  590.     }
  591.  
  592. function moveTo (xPos,yPos)
  593.     {
  594.     this.style.pixelLeft = xPos ;
  595.     this.style.pixelTop = yPos ;
  596.     }
  597.  
  598. function showIt(on)
  599.     {
  600.     if (NS4)
  601.         this.visibility = (on) ? "show" : "hide" ;
  602.     else
  603.         this.style.visibility = (on) ? "visible" : "hidden" ;
  604.     this.currentItem = null ;
  605.     }
  606.  
  607. function linkIt ()
  608.     {
  609.     trgLoc.location.href = this.linkText ;
  610.     if (isFrames)
  611.         {
  612.         hideAll () ;
  613.         return true ;
  614.         }
  615.       else
  616.         return false ;
  617.     }
  618.  
  619. function popDown (menuName)
  620.     {
  621.     if (!areCreated)
  622.         return ;
  623.     theEl = eval (menuName) ;
  624.     theEl.isOn = false ;
  625.     if (!NS4 && !IE4)
  626.         theEl.hideTop () ;
  627.     }
  628.  
  629. function hideAll ()
  630.     {
  631.     for (i = 1 ; i < topCount ; i++)
  632.         {
  633.         temp = eval ("elMenu" + i + ".startChild") ;
  634.         temp.isOn = false ;
  635.         if (temp.hasChildVisible)
  636.             temp.hideChildren () ;
  637.         temp.showIt (false) ;
  638.         }
  639.     }
  640.  
  641. function hideTree ()
  642.     { 
  643.     if (isOverMenu)
  644.         return ;
  645.     if (this.hasChildVisible)
  646.         this.hideChildren () ;
  647.     this.hideParents () ;
  648.     }
  649.  
  650. function hideTop ()
  651.     {
  652.     theEl = this ;
  653.     if (NS4 || IE4) 
  654.         theEl.hideSelf() ;
  655.     }
  656.  
  657. function hideSelf ()
  658.     {
  659.     if (!this.isOn && !isOverMenu)
  660.         this.showIt (false) ;
  661.     }
  662.  
  663. function hideParents ()
  664.     {
  665.     tempMenu = this ;
  666.     while (tempMenu.hasParent)
  667.         {
  668.         tempMenu.showIt (false) ;
  669.         tempMenu.parentMenu.isOn = false ;
  670.         tempMenu = tempMenu.parentMenu ;
  671.         }
  672.     tempMenu.hideTop () ;
  673.     }
  674.  
  675. function hideChildren (item)
  676.     {
  677.     tempMenu = this.visibleChild ;
  678.     while (tempMenu.hasChildVisible)
  679.         {
  680.         tempMenu.visibleChild.showIt (false) ;
  681.         tempMenu.hasChildVisible = false ;
  682.         tempMenu = tempMenu.visibleChild ;
  683.         }
  684.  
  685.     if (!this.isOn || !item.hasMore || this.visibleChild != this.child)
  686.         {
  687.         this.visibleChild.showIt (false) ;
  688.         this.hasChildVisible = false ;
  689.         }
  690.     }
  691.  
  692. function cancelSelect ()
  693.     {
  694.     return false ;
  695.     }
  696.  
  697. function clicked ()
  698.     {
  699.     if (!isOverMenu && currentMenu!=null && !currentMenu.isOn)
  700.         {
  701.         theEl = currentMenu ;
  702.         theEl.hideTree () ;
  703.         }
  704.     oldLinkEl = null ;
  705.     }
  706.