﻿        var sitem;
        
        window.onload = function()  {
        // get all the DT elements 
        var all = document.getElementsByTagName("DT");
        
        for (var i=0;i<all.length;i++) {
            if(all[i].className == "item") {
               all[i].onmouseover = liMouseOverHandler; // add the mouseover event for list-item
               } // end if
         } // end for
         
         // get the ct100_menutree element
         
         var d = document.getElementById("ctl00_menutree");
         // get the array with childnodes of the element
         var children = d.childNodes; //used for FF, because childNodes doesn't work in FF
         for(var j = 0; j<children.length; j++) {
                // item(j) also for FF, otherwise I could use childNodes[j]
                if (children.item(j).nodeType==1) {
                    // check if is a DD element
                   if(children.item(j).nodeName =="DD") {
                        // set the display attribute to none
                         children.item(j).style.display='none';
                   } // end if 
                } //end if
         } // end for
         } // end function
            
        function liMouseOverHandler() {
            // get the next node, because this is a DT node
            sitem = getNextSibling(this);
            // get the ct100_menutree element
            var d = document.getElementById("ctl00_menutree");
            // get the array with childnodes of the element
            var children = d.childNodes; //used for FF, because childNodes doesn't work in FF
            for(var i = 0; i<children.length; i++) {
                // item(i) also for FF, otherwise I could use childNodes[i]
                if (children.item(i).nodeType==1) {
                // check if is a DD element
                    if(children.item(i).nodeName =="DD") {
                    // set the display attribute to none
                    children.item(i).style.display='none';
                    } // end if
                } // end if
            }//end for 
            // check if the browser is FF
            if (navigator.appName == "Netscape") {
                // childNodes[0] in this case is text, so we need the next sibling
                if(getNextSibling(sitem).hasChildNodes() == true) {
                    sitem.style.display='block'; // set the display attribute to block
                }// end if
            } // end if
            else {
                // else if the browser is not FF, childNodes[0] is in this case the first element
                if(sitem.childNodes[0].hasChildNodes() == true) {
                    sitem.style.display='block';
                } // end if
            } // end else
       }// end function liMouseOverHandler
                
       function getNextSibling(startNode) {
            // start going througs the nodes, get the reference to the next sibling
            var endNode=startNode.nextSibling;
            // while endNode is not an element node
            while(endNode.nodeType!=1) {
                endNode = endNode.nextSibling; // get reference to the next sibling
            }
            return endNode; // return the element node
       } // end function getNextSibling 


   
