

//---------------------------------------------------------------
//--multiLayerScript.js' -- version 1.2.2 - (2004.02.09) -- BM --
//---------------------------------------------------------------
//--use this variables to move the all layers down/right
var moveDown = 35;
var moveRight = 0;
//--delayed hide of all layers (msec), timer - onmouseOut
var delayedHide = 1000;
//--------------------------------------------------------
//--layers basic functions: show/hide DIV's
//--------------------------------------------------------
var iexpl;
var netsc4;
var netsc6;
netsc4 = (document.layers) ? 1:0;
iexpl = (document.all) ? 1:0;
netsc6 = (!document.all && document.getElementById) ? 1:0;
if (navigator.userAgent.indexOf('Opera') > -1) {//--opera
 iexpl = 0;
 netsc6 = 1;
}
//--onmouseOut-timer functions: to hide all the DIV's
var runTime;

function startTimer() {
    runTime = setTimeout('hideAll()',delayedHide);
}

function resetTimer() {
 clearTimeout(runTime);
}
//--show the menu (DIV)
function showMenu(myDiv) {
 hideAll();
 showDiv(myDiv);
 
}
//--hide all DIV's
function hideAll() {
 var divArray = null;
 if (iexpl) {
  divArray = document.all.tags('div');
 }
 if (netsc4) {
  divArray = document.layers;
 }
 if (netsc6) {
  divArray = document.getElementsByTagName('div');
 }
 totalDivs = divArray.length;
 for ( i=0; i<totalDivs; i++ ) {
  var myDiv = '';
  if ( !netsc6) {//--IE, NS4
   if (divArray[i].name!=null) {
    myDiv = ''+divArray[i].name;
   } else if (divArray[i].NAME!=null) {
    myDiv = ''+divArray[i].NAME;
   }
  } else {//--NS6, Opera
   if (divArray[i].id!=null) {
    myDiv = ''+divArray[i].id;
   } else if (divArray[i].ID!=null) {
    myDiv = ''+divArray[i].ID;
   }
  }
  if ( myDiv.indexOf('sub') > -1 ) {
   hideDiv(myDiv);
  }
 }
 
 divArray = document.getElementsByTagName('a');
 totalDivs = divArray.length;
 for ( i=0; i<totalDivs; i++ ) {
  var myDiv = '';
  if (divArray[i].id!=null) {
    myDiv = ''+divArray[i].id;

   }
   if ( myDiv.indexOf('a_sub') > -1 ) {
    if (document.getElementById(myDiv).className == "selected") {
    document.getElementById(myDiv).style.backgroundPosition = "0% -78px";
    document.getElementById(myDiv).firstChild.style.backgroundPosition = "100% -78px";
    } else {
    document.getElementById(myDiv).style.backgroundPosition = "0% 0px";
    document.getElementById(myDiv).firstChild.style.backgroundPosition = "100% 0px";
    }
   }
  }
}
//--hide a DIV with specific name/id = 'myDiv'
function hideDiv(myDiv) {
 var myDiv;
 if (iexpl) {
  myDiv = document.all[myDiv];
  if (myDiv) {
   myDiv.style.visibility='hidden';
  }
 }
 if (netsc4) {
  myDiv = document.layers[myDiv];
  if (myDiv) {
   myDiv.visibility='hide';
  }
 }
 if (netsc6) {
  myDiv = document.getElementById(myDiv);
  //alert(myDiv.style.visibility);
  if (myDiv) {
   myDiv.style.visibility='hidden';
  }
 }
}
//--show the DIV ('subx'), and moves it's left-top position to the anchor ('a_subx')
function showDiv(myDiv) {
 var coordinates = getCoor('a_' + myDiv);
 var xPos = coordinates.x + moveRight;
 var yPos = coordinates.y + moveDown;
 if (netsc6 || netsc4) {
  myDiv = document.getElementById(myDiv);
  if (myDiv) {
   //alert ('xPos = ' + xPos);
   //alert ('offsetWidth = ' + myDiv.offsetWidth);
//   if (myDiv.offsetWidth + xPos - 322 > 690) {    
//    var toolarge = -(690 - (xPos - 322) - myDiv.offsetWidth);
    //alert ('te breed: ' + toolarge);
//    var newxPos = xPos - toolarge;
    //alert ('nieuwexPos' + newxPos);
//    myDiv.style.left = newxPos+'px';
//   } else {
    myDiv.style.left=xPos.toString()+'px';
//   }
   
   myDiv.style.top=yPos.toString()+'px';
   myDiv.style.visibility='visible';
   //alert(myDiv.offsetWidth);
  }
 }
  
 if (iexpl) {
  myDiv = document.getElementById(myDiv);
  if (myDiv) {
   //alert ('xPos = ' + xPos);
   //alert ('offsetWidth = ' + myDiv.offsetWidth);
   /*if (myDiv.clientWidth + xPos - 322 > 650) {    
    var toolarge = -(650 - (xPos - 322) - myDiv.clientWidth);
    var newxPos = xPos - toolarge;
    myDiv.style.left = newxPos+'px';
   } else {*/
    myDiv.style.left=xPos.toString()+'px';
    //alert ('xPos = ' + xPos);
   /*}*/
   
   myDiv.style.top=yPos.toString()+'px';
   myDiv.style.visibility='visible';
   //alert(myDiv.clientWidth);
  }
 }
}
//--get the postion of an object via 'name' / 'id'
function getCoor(n) {
 var coo = new Object();
 if (netsc4) {//--workaround for NS4
  var anchObj;
  coo.x = window.event.target.x;
  coo.y = window.event.target.y;
 } else {
  var i,x;
  if(!(x=document[n])&&document.all) {//--IE
   x=document.all[n];
  }
  if(!x && document.getElementById) {//--NS6
   x=document.getElementById(n);
  }
  var ol=x.offsetLeft;
  var ot=x.offsetTop;
  while ((x=x.offsetParent) != null) {
   ol += x.offsetLeft;
   ot += x.offsetTop;
  }
  coo.x = ol;
  coo.y = ot;
 }
 return coo;
}
//--NS 4.x specific
//--functions to capture the onClick AND onmouseOver-events
//--detecting the onmouseOver-events work only with <A HREF="#" onmouseOver="... ==> OK
//--not on <TD>'s: e.g.: <TD onmouseOver="... ==> NOT OK
if (netsc4) {
 if(!window.event && window.captureEvents) {
  //window.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT|Event.CLICK|Event.DBLCLICK);
  window.captureEvents(Event.MOUSEOVER|Event.CLICK);
  window.onmouseover = getCursorHandler;
  window.onclick = getCursorHandler;
  window.event = new Object;
 }
}
function getCursorHandler(e) {
 window.event.target = e.target;
 if (e.type=='click') {
  hideAll();
 }
 if ( routeEvent(e) == false ) {
  return false;
 } else {
  return true;
 }
}
//---------------------------------------------------------------------------
//--author: Winsome Benelux - Benny Meyns
//--www.webengine.be - www.winsome.be
//------------------------
//--BROWSER-COMPATIBILITY:
//--PC - IE6.0: OK
//--PC - NS7.0: OK
//--PC - NS6.0: OK
//--PC - NS4.0: OK, if onmouseOver="showMenu('subx');" on <A HREF , not on <TD
//--PC - Opera 7.01: OK
//-----------------
//--MAC - IE5.1: OK
//--MAC - NS6.0: OK
//---------------------------------------------------------------------------