<!--


var Opera = window.opera ? true : false;

// ----------------------- CLIENT-CHECK
function getClient() {
  // convert all characters to lowercase to simplify testing
  var agt=navigator.userAgent.toLowerCase()
  var apv=navigator.appVersion.toLowerCase()
  this.major = parseInt(navigator.appVersion)
  // browserversion
  this.ns  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)))
  this.gecko = (this.ns && (this.major >= 5))
  this.ie   = (agt.indexOf("msie") != -1)
  this.ie4  = (this.ie && (this.major == 3))
  this.ie45 = (agt.indexOf('msie 4.5') != -1);
  this.ie5  = (this.ie && (this.major == 4))
  // IE 5 or 5.5
  this.ie555 = (agt.indexOf('msie 5.5') != -1);
  //Safari
  this.isSafari = (agt.indexOf('safari') != - 1);
  this.versionMinor = parseFloat(navigator.appVersion);
  this.isSafari10 = ((this.isSafari) && (this.versionMinor < 87));
  //Mozilla
  this.moz = ((agt.indexOf('mozilla') != -1)&& (agt.indexOf('gecko') != -1) && (agt.indexOf('netscape') == -1));
  // platform
  this.mac = (apv.indexOf("macintosh")>0);
  // compatible browsers
  this.ie4comp = ((this.ie4 && !this.mac) || this.ie45 || this.ie5)
  this.comp = (this.ie4comp || this.gecko);
  return (this)
}

var is = new getClient();

// ----------------------- IMAGE PRELOAD
function preloadImages() {
  if (document.images) {
    var imgStr = preloadImages.arguments;
    if (!document.preloadArray) document.preloadArray = new Array();
    var n = document.preloadArray.length;
    for (var i=0; i<preloadImages.arguments.length; i++) {
      document.preloadArray[n] = new Image;
      document.preloadArray[n].src = imgStr[i];
      n++;
    }
  }
}

// ----------------------- SWAP-IMAGE SUBMIT BG:
function roSubmit(id,pic,pos){
  if(is.comp && !(is.mac && is.ie4comp)){
    var ref = document.getElementById(id);
    ref.style.background = "url('" + pic + "') no-repeat";
    if(roSubmit.arguments.length > 2) {
      if (pos==1){ ref.style.backgroundPosition = 'right'; }
    }
  }
}

function roSubmit(id,pic,pos,color){
  if(is.comp && !(is.mac && is.ie4comp)){
    var ref = document.getElementById(id);
    ref.style.color = color;
    ref.style.cursor= "pointer";
    ref.style.background = "url('" + pic + "') no-repeat";
    if(roSubmit.arguments.length > 2) {
      if (pos==1){ ref.style.backgroundPosition = 'right'; }
    }
  }
}

function roSubmitImg(id,pic){
  if(is.comp && !(is.mac && is.ie4comp)){
    var ref = document.getElementById(id);
    ref.src = pic;
  }
}

// ----------------------- SETTING THE FOOTER
function getWindowHeight() {
  var windowHeight = 0;
  if (typeof(window.innerHeight) == 'number') {
    windowHeight = window.innerHeight;
  }
  else {
    if (document.documentElement && document.documentElement.clientHeight) {
      windowHeight = document.documentElement.clientHeight;
    }
    else {
      if (document.body && document.body.clientHeight) {
        windowHeight = document.body.clientHeight;
      }
    }
  }
  return windowHeight;
}
function setFooter() {
  if (document.getElementById && !(is.ie4comp && is.mac)) {
    document.getElementById('content-layer').style.paddingBottom = '0px';
    var mozCorrection = 0;
    if(is.moz && !is.isSafari){ mozCorrection = 1.1; }
    var windowHeight = getWindowHeight();
    if (windowHeight > 0) {
      var headerHeight = document.getElementById('logo-layer').offsetHeight;

      var contentHeight = document.getElementById('content-layer').offsetHeight;
      var footerElement = document.getElementById('footer-layer');
      var footerHeight  = footerElement.offsetHeight + 200;
      if (windowHeight - (headerHeight + contentHeight + footerHeight) >= 0) {
        footerElement.style.position = 'relative';
        footerElement.style.top = (windowHeight - (headerHeight + contentHeight + footerHeight) - mozCorrection) + 'px';
        document.getElementById('all-container').style.height = '100%';
      }
      else {
        footerElement.style.position = 'static';
      }
    }
  }
}

window.onload = function() {
  setFooter();
}
window.onresize = function() {
  setFooter();
  if(pageType == "detail") { margeblokMove(); }
}

// ----------------------- MENU FUNCTIONS

var mouseX;
var mouseY;

function getMouseXY(e) {
  if (is.ie4comp) { // grab the x-y pos.s if browser is IE
    mouseX = event.clientX + document.body.scrollLeft;
    mouseY = event.clientY + document.body.scrollTop;
  }
  else {  // grab the x-y pos.s if browser is not IE
    mouseX = e.pageX;
    mouseY = e.pageY;
  }
}

function captureMouse(){
  if (is.comp && (!(is.ie4comp))) document.captureEvents(Event.MOUSEMOVE)
  document.onmousemove = getMouseXY;
}

// --- NAVIGATIE ---

var menuActive = "transparent url(../img/bullets/menu_white_arrow.gif) no-repeat";
var menuHover = "transparent url(../img/bullets/menu_white_square.gif) no-repeat";

// ------------------------------ TOON VERBERG SUBMENUS ------------------------------

var menuTimer;
var subMenuTimer;

var activeLink = '';
var openSub = '';
var openLink = '';
var prevSub = '';
var prevLink = '';
var skipSub = '';
var skipLink = '';
var lastWhitedot = '';

var checkA = null;
var doS = null;

var timerSub = 250; // aantal miliseconden vertraging openen submenu

var allSubs = new Array(); // alle mainmenu-items

function resetSubMenuListener() {
  if (is.comp && pageType == 'index') {
    var scrollTopPage;
    var t = document.getElementById('menu-all-layer').offsetTop; //update berekening i.v.m. mogelijke fontvergroting
    var h = document.getElementById('menu-all-layer').offsetHeight; //update berekening i.v.m. mogelijke fontvergroting
    if( typeof( window.innerHeight ) == 'number' ) {
      //Non-IE
      scrollTopPage = window.pageYOffset;
    } else if( document.documentElement && document.documentElement.clientHeight ) {
      //IE 6+ in 'standards compliant mode'
      scrollTopPage = document.documentElement.scrollTop;
    } else if( document.body && document.body.clientHeight ) {
      //IE 4 compatible
      scrollTopPage = document.body.scrollTop;
    }
    if ((mouseY + scrollTopPage) > (t + h)) {
      resetSubMenu();
    }
    if(!is.moz || is.isSafari) { subMenuTimer = setTimeout('resetSubMenuListener()',1000); }
  }
}

function resetSubMenu(){
  if (is.comp && openLink != '') {
    document.getElementById(openLink).style.background = 'transparent';
    document.getElementById(openSub).style.left = '-1000px';
  }
  if(is.comp && curLink != '') {
    skipLink = curLink;
    openLink = curLink;
    document.getElementById(curLink).style.background = menuActive;
    if(curSub != ''){
      openSub = curSub;
      doOpenSub();
    }
  }
  //clearTimeout(subMenuTimer);
}

function showSub(thisId, relSub){
  if (is.comp && (thisId!=skipLink) && (skipLink!='')){
    lastWhitedot = thisId;
    document.getElementById(thisId).style.background = menuHover;
  }
  activeLink=thisId; // stelt ge-rolloverde link als actief.
  setTimeout('tryOpenSub("' + thisId +'", "' + relSub + '")', timerSub); // kijkt na timer sec. of gebruiker nog op hetzelfde mainmenu-item staat.
}

// vergelijkt actieve mainmenu-item met huidige mainmenu-item
function tryOpenSub(thisId, relSub){
  if(is.comp && thisId==activeLink){
    prevLink = openLink;
    openLink = thisId;
    prevSub = openSub;
    openSub = relSub;
    doOpenSub();
  }
}

// toont inhoud van mainmenu-item
function doOpenSub(){
  if (is.comp && prevLink != '') {
    document.getElementById(prevLink).style.background = 'transparent none no-repeat';
    document.getElementById(prevSub).style.left = '-1000px';
  }
  document.getElementById(openLink).style.background = menuActive;
  if(is.comp && openSub != '') {
    var thisRef = document.getElementById('main-menu-layer');

    var x = 0;
    var y = 0;

    while( thisRef.offsetParent != null ) {
      y +=thisRef.offsetTop;
      x += thisRef.offsetLeft;
      thisRef = thisRef.offsetParent;
    }

    var posx = x + 250;
    var posy = y;
    if( pageType=='index' ) { posy += 10; }
    else { posy = document.getElementById('target-groups').offsetHeight + 10; }

    document.getElementById(openSub).style.left = posx + 'px';
    document.getElementById(openSub).style.top = posy + 'px';
  }
  skipLink = openLink;
}


// de-activeer mainmenu-item
function noSub(){
  if (is.comp && (lastWhitedot!=skipLink) && (lastWhitedot!='')){
    document.getElementById(lastWhitedot).style.background = 'transparent none no-repeat';
  }
  activeLink='';
}

// init function
function init(){
  if(is.comp && pageType=="index"){
    setFooter();
  //  captureMouse();
  //  resetSubMenuListener();
  //  resetSubMenu();
  }
  if(is.comp && pageType=="detail"){
    captureMouse();
    initMargin();
  //  setFooter();
  //  initMenu();
  }
}

//-->