﻿function Node(obRef)
{
   this.obRef=obRef;
   this.timeRef=null;
}
myNodes=new Array();
 
function isParent(kind, ouder)
{
   oudere=kind.parentNode;
   do
   {
      oudere=oudere.parentNode;
      if (oudere==ouder)
      {
         return true;
      }
   }
   while (oudere.nodeName!='BODY')
   return false;
}
 
function showSub(showNode)
{
   if (isNaN(showNode.rIndex))
   {
      showNode.rIndex=myNodes.length;
      myNodes[showNode.rIndex]=new Node(showNode);
   }
   else
   {
      clearTimeout(myNodes[showNode.rIndex].timeRef);
   }
   temp='';
   for (i in myNodes)
   {
      if (!isParent(myNodes[i].obRef, showNode))
      {
         clearTimeout(myNodes[i].timeRef);
         doHide(myNodes[i].obRef);
      }
   }
   for (i in showNode.childNodes)
   {
      if (showNode.childNodes[i].nodeType==1)
      {
         showNode.childNodes[i].style.display='block';
      }
   }
}
 
function hideSub(hideNode)
{
   myNodes[hideNode.rIndex].timeRef=setTimeout('doHide(myNodes['+hideNode.rIndex+'].obRef)', 500);
}
 
function doHide(doNode)
{
   for (i in doNode.childNodes)
   {
      if (doNode.childNodes[i].nodeType==1 && doNode.childNodes[i].nodeName=='UL')
      {
         doNode.childNodes[i].style.display='none';
      }
   }
}
window.onload=function()
{
   var li = document.getElementById('menu').getElementsByTagName('li');
   var ul;
   for (i in li)
   {
      if(!isNaN(i))
      {
         ul = li[i].childNodes;
         for(j in ul)
         {
            if(ul[j].nodeName == 'UL')
            {
               ul[j].className = li[i].className = 'sub';
               li[i].onmouseover = function ()
               {
                  showSub(this);
               }
               li[i].onmouseout = function ()
               {
                  hideSub(this);
               }
            }
         }
      }
   }
}



<!--
function popup(folder,bestand,b,h) {
  var loc=""+folder+"/"+bestand;
  var parameters="toolbar=no,scrollbars=no,location=no,status=no,menubar=no,resizable=no,top=0,left=0,width="+b+",height="+h;
  foto = window.open("","pic",parameters);
  foto.moveTo((screen.availWidth-b)/2, (screen.availHeight-h)/2);
  foto.document.write("<html><head><title>:: Pic - "+bestand+" ::</title></head>");
  foto.document.write("<style>body { margin: 0px;overflow: hidden; }</style>");
  foto.document.write("<body><a href='javascript:window.close();' title='[Klik om te sluiten]'><img src='"+loc+"' border='0' height="+h+"></a></body></html>");
  foto.document.close();
}

//-->

