<!--
////JAVASCRIPT VOOR EEN MENUBALK  HORIZONTAAL MET DE SUBMENUS IN EEN LIJST///////////////////////////////
////ARRAY -- VARIABELEN VOOR HOOFDMENU EN DIENS SUBMENU//////////////////////////////////////////////////
KOPenSUBs = new Array();
KOPenSUBs[0] = new Array(["Home","test2.html"]);

////GLOBALE VARIABELEN////////////////////////////////////////////////////////////////////////////////////
var menuSubCSS="sub_zwart";        //CLASS uit de stylesheet voor het submenu
var menuKopCSS="menu_zwart";      //CLASS uit de stylesheet voor het hoofdmenu
var marge_links = 0;		 //marge links van de hoofdmenu balk
var marge_rechts = 0;		 //marge rechts van de hoofdmenu balk
var y_pos_submenu = 250;	 // y_positie van de de submenu's
var standaard_breedte = "90";     //standaard breedte van iedere hoofdmenu item
var standaard_hoogte = 16;       //standaard hoogte van de regels van de hoofd en sub- menu items
var TargetFrame	= "";		 //property target van de <a>-tag
var timeOutID = null;		 //delay in het verbergen van het submenu
var HTMLstr = "";		 //de uiteindelijke outputstring
var breedte_totaal = "";	 //totale breedte van de hoofdmenu balk (marge_links + 
				 //aantalitems * standaard_breedte + marge_rechts); wordt gegenereerd

////FUNCTIES/////////////////////////////////////////////////////////////////////////////////////////////
function voegKOPtoe(idKOP, tekst, link,positie){
  var MENUitem = "";
  if(menuKopCSS=="menu_rood"){
    menuSubCSS="sub_zwart";
    menuKopCSS="menu_zwart";
  }else{
    menuSubCSS="sub_rood";
  menuKopCSS="menu_rood";
  }
  if (n){
    MENUitem += "<td  class='"+menuKopCSS+"' width='"+standaard_breedte+"' height='"+standaard_hoogte+"'>\n";
    MENUitem += "<ilayer name="+idKOP+"  class='"+menuKopCSS+"' width='"+standaard_breedte+"'  style='position:relative;left="+positie+"'>";
    if(link==null)link="#";
    MENUitem += "<a href='"+link+"' class='"+menuKopCSS+"'";
    MENUitem += " onMouseOver='LaatSubMenuZien(";
    MENUitem += '"';
    MENUitem += idKOP;
    MENUitem += '"';
    MENUitem += ")' onMouseOut='VerbergSubMenu();'>";
    MENUitem += "&nbsp;&nbsp;";
    MENUitem += tekst;
    MENUitem += "&nbsp;";
    MENUitem += "</a>";
    MENUitem += "</ilayer>";
    MENUitem += "</td>\n";
  }
  else if (ie){
    MENUitem += "<td class='"+menuKopCSS+"' width='"+standaard_breedte+"' height='"+standaard_hoogte+"'>\n";
    MENUitem += "<div id='"+idKOP+"' width='"+standaard_breedte+"' style='position:relative;'";
    MENUitem += 'onMouseOver="';
    MENUitem += "LaatSubMenuZien('"+idKOP+"');";
    MENUitem += '" ';
    MENUitem += 'onMouseOut="VerbergSubMenu();">\n';
    if(link==null)link="#";
    MENUitem += "<a href='"+link+"' class='"+menuKopCSS+"'>";
    MENUitem += "&nbsp;&nbsp;";
    MENUitem += tekst;
    MENUitem += "&nbsp;";
    MENUitem += "</a>\n";
    MENUitem += "</div>\n"; 
    MENUitem += "</td>\n";
  }
  MENUitem += "<!-- HOOFD_MENU -->\n";
  HTMLstr = HTMLstr.replace("<!-- HOOFD_MENU -->\n",MENUitem);
}

function voegSUBtoe(idKOP, tekst, locatie, x_pos){
var MENUitem = "";
var DUMMY = "<!-- VOLGENDE_ITEM VAN "+idKOP+" -->\n";
var naamSUB = idKOP + "submenu";
  if (HTMLstr.indexOf(naamSUB) == -1){
    if (n){
      MENUitem += "<DIV name='"+naamSUB+"' style='position:absolute; visibility:hide; top:"+y_pos_submenu+"px; left:"+x_pos+"px;'";
      MENUitem += " onMouseOut='VerbergSubMenu();' onMouseOver='HuidigMenuZien();'";
      MENUitem += "'>\n";
      MENUitem += "<table class='"+menuSubCSS+"' border='0'>\n";
      MENUitem += DUMMY;
      MENUitem += "</table>\n";
      MENUitem += "</DIV>\n";
    }
    if (ie){
      MENUitem += "<span id='"+naamSUB+"' class="+menuSubCSS+" onMouseOut='VerbergSubMenu();'";
      MENUitem += " onMouseOver='HuidigMenuZien();'";
      MENUitem += " style='position:absolute; visibility:hidden; top:"+y_pos_submenu+"px; left:"+x_pos+"px;'>\n";
      MENUitem += "<table class='"+menuSubCSS+"' border='0'>\n";
      MENUitem += DUMMY;
      MENUitem += "</table>\n";
      MENUitem += "</span>\n";
    }
    MENUitem += "<!-- SUB_MENU -->\n";
    HTMLstr = HTMLstr.replace("<!-- SUB_MENU -->\n",MENUitem);
  }
//MENUitem = "<tr><td width='"+standaard_breedte+"'><a href='"+locatie+"' class='"+menuSubCSS+"' target='"+TargetFrame+"'>&nbsp;"+tekst+"&nbsp;</a></td></tr>\n";
  MENUitem = "<tr><td width=120><a href='"+locatie+"' class='"+menuSubCSS+"' target='"+TargetFrame+"'>"+tekst+"</a></td></tr>\n";
  MENUitem += DUMMY;
  HTMLstr = HTMLstr.replace(DUMMY, MENUitem);
}

function SchrijfMenuBar(){
  document.writeln(HTMLstr);
}

function MenuBar(){
  this.voegKOPtoe    = voegKOPtoe;
  this.voegSUBtoe = voegSUBtoe;
  this.SchrijfMenuBar   = SchrijfMenuBar;

  LaatsteSubMenu = null;
  LaatsteKOP = null;

  HTMLstr = "<!-- MENU -->\n";
  HTMLstr += "<table width='"+breedte_totaal+"' height='"+standaard_hoogte+"' cellpadding=0 cellspacing=0 border=0>\n";
  HTMLstr += "<tr>";
  HTMLstr += "<td width='"+marge_links+"' height='"+standaard_hoogte+"'>&nbsp;</td>";
  HTMLstr += "<!-- HOOFD_MENU -->\n";
  HTMLstr += "<td class='menu_rood' width='"+marge_rechts+"' height='"+standaard_hoogte+"'>&nbsp;</td>";
  HTMLstr += "</tr>\n";
  HTMLstr += "</table>\n";
  HTMLstr += "\n";
  HTMLstr += "<!-- SUB_MENU -->\n";
  HTMLstr += "\n";
}

function LaatSubMenuZien(idKOP){
var naamSUB = idKOP + "submenu";
var menu; 
var submenu;

  if (n){
     if (document.layers[naamSUB] != null){
	menu = document.layers[idKOP];
	submenu = document.layers[naamSUB];
     }
  }else if(ie){
      if (document.all.item(naamSUB) !=null){
        menu = document.all.item(idKOP).style;
        submenu = document.all.item(naamSUB).style;
      }
  }
  if (LaatsteSubMenu != null && LaatsteSubMenu != submenu){
      	HuidigMenuVerbergen();
  }
  submenu.visibility = zien;
  HuidigMenuZien();  
  LaatsteSubMenu = submenu;
  LaatsteKOP = menu;
}

function HuidigMenuVerbergen(){
  if(LaatsteSubMenu != null){
    LaatsteSubMenu.visibility = verberg;
    LaatsteSubMenu = null;
    LaatsteKOP = null;
    if (timeOutID){
   	 clearTimeout(timeOutID);
    	timeOutID = null;
    }
  }
}

function HuidigMenuZien(){
   if (timeOutID)
  {
    clearTimeout(timeOutID);
    timeOutID = null;
  }
}

function VerbergSubMenu(){
    timeOutID = setTimeout("HuidigMenuVerbergen()", 1000)
}

function VerbergDirect(){
    clearTimeout(timeOutID);
    timeOutID = null;
    HuidigMenuVerbergen();
}

function MaakMenuBalk(){
  breedte_totaal = marge_links+(KOPenSUBs.length*standaard_breedte)+marge_rechts;
  var menubar = new MenuBar();
  for(i=0;i<KOPenSUBs.length;i++){
    if (i==1) {
      x_pos = 90;
    }
    else {
      x_pos = (marge_links + ((i)*standaard_breedte)); 
    }
    menubar.voegKOPtoe(KOPenSUBs[i][0][0],KOPenSUBs[i][0][0],KOPenSUBs[i][0][1],x_pos);
    for(y=1;y<KOPenSUBs[i].length;y++){
      menubar.voegSUBtoe(KOPenSUBs[i][0][0], KOPenSUBs[i][y][0], KOPenSUBs[i][y][1],x_pos);	
    }
  }
  menubar.SchrijfMenuBar();
}
////EXECUTIVE SCRIPT//////////////////////////////////////////////////////////////////////////////////////
if (document.all)
{
  //alert('ie');
  n=0;
  ie=1;
  zien="visible";
  verberg="hidden";
}
else 
{
  //alert('ns');
  n=1;
  ie=0;
  zien="show";
  verberg="hide";
  
    n=0;
  ie=1;
  zien="visible";
  verberg="hidden";
}

MaakMenuBalk();

if (ie){
  document.body.onclick=VerbergDirect;
  document.body.onscroll=VerbergDirect;
}
else if(n){
  document.onmousedown=VerbergDirect;
  window.captureEvents(Event.MOUSEMOVE);
}
//-->
