  //Make the array to hold the menu timeouts
   
      var timeOn = [null, null];

      function treeMenu(itemid)
      {
       
        //Reset the timeout
        clearTimeout(timeOn[itemid]);
        //Make the div visible
        document.getElementById(itemid).style.visibility="visible";
      }

      function treeMenuOff(itemid)
      {
        //Set timeout to hide the menu
        timeOn[itemid] = setTimeout("hideMenu('"+itemid+"')", 500);
      }

      function hideMenu(itemid)
      {
        //Hide the menu after the timeout
        document.getElementById(itemid).style.visibility="hidden";
      }
