function hiliteImg(obj) {
  theElement = obj;
  S = theElement.src;
  if (S.charAt(S.length-5) == '0') theElement.src = S.slice(0,S.length-5) + '1' + S.slice(S.length-4);
  }

function restoreImg(obj) {
  theElement = obj;
  S = theElement.src;
  if (S.charAt(S.length-5) == '1') theElement.src = S.slice(0,S.length-5) + '0' + S.slice(S.length-4);
  }
  
function hilitemap(n) {
  theElement = document.images["pict"];
  S = theElement.src;
  if (S.charAt(S.length-5) == '0') theElement.src = S.slice(0,S.length-5) + n + S.slice(S.length-4);
  }

function restoremap(n) {
  theElement = document.images["pict"];
  S = theElement.src;
  theElement.src = S.slice(0,S.length-5) + '0' + S.slice(S.length-4);
  }
  
var scrollPos = 32;
function updateTopButton() {
  if (document.body.scrollTop > 0) {
    document.all("TopBtn").style.visibility = 'visible';
    document.all("TopBtn").style.pixelLeft = parseInt(document.body.clientWidth)-((parseInt(document.body.clientWidth)-312)/parseInt(document.body.clientWidth))*460+parseInt(document.body.scrollLeft);
    document.all("TopBtn").style.pixelTop = parseInt(document.body.clientHeight)-60+parseInt(document.body.scrollTop)+scrollPos;
    }
  else {
    document.all("TopBtn").style.visibility = 'hidden';
    }
  }

var popup = null;
function openPopUp(begrip,id,t) {
  var featureString = ((begrip)?('width=320,height=200,left=60,top=120,toolbar=no,scrollbars=yes'):('width=560,height=400,left=60,top=120,toolbar=yes,scrollbars=yes'));
  var old=popup;
  url = ((begrip)?("page.asp?id="+id+"&begrip="+t.substring(8,t.length)):("page.asp?id="+id));
  var bla="abcdefgh";
  var rand=""+Math.random();
  var pid="popup";
  for (i=0;i<6;i++) pid+=bla.charAt(parseInt(rand.charAt(2+i)));
  popup = window.open(url, pid, featureString);
  popup.focus();
  if (old!=null) old.close();
  }
  
var lastId = 'default';
function showTijdstip(theId) {
  document.all("tijdstip_"+lastId).style.display = "none";
  document.all("tijdstip_"+theId).style.display = "block";
  document.all("tijdstip_"+theId).focus();
  lastId = theId;
  }
  
function hiliteTijdstip(theId) {
  document.all("gebeurtenis_"+theId).style.color = '#cc3300';
  }
  
function restoreTijdstip(theId) {
  document.all("gebeurtenis_"+theId).style.color = '#000000';
  }
  
var tijdIndex = 0;
function scrollTijd(obj,direction) {
  if (tijdIndex + direction > document.all("tijdkolom").length-5) {
    return;
    }
  else if (tijdIndex + direction < -1) {
    return;
    }
  
  tijdIndex += direction;
  var total = 0;
  for (var i=0; i<document.all("tijdkolom").length; i++) {
    if ((i+total>tijdIndex) && (total < 4)) {
      document.all("tijdkolom")[i].style.display = "block";
      total++;
      }
    else document.all("tijdkolom")[i].style.display = "none";
    }
  document.all("tijd_min").style.visibility = (tijdIndex >= 0)?"visible":"hidden";
  document.all("tijd_plus").style.visibility = (tijdIndex < document.all("tijdkolom").length-5)?"visible":"hidden";
  document.all("tijdstip_"+lastId).focus();
  }
  
var nowColor,colorTimer,fadeUrl,fadeColor,total;

function fadeToUrl(url,color) {
  total = 0;
  nowColor = document.body.bgColor;
  fadeColor = color;
  fadeUrl = url;
  if (document.all) colorTimer = window.setTimeout('realFade()',5);
  else self.location = "page.asp?id="+fadeUrl;
  }
  
function realFade() {
  clearTimeout(colorTimer);

  finishR = false;
  finishG = false;
  finishB = false;

  colR = parseInt("0x"+nowColor.substring(1,3));
  fadeR = parseInt("0x"+fadeColor.substring(1,3));
  f = (Math.abs(colR-fadeR) > 10)?10:1;
  if (colR>fadeR) colR-=f; else if (colR<fadeR) colR+=f; else {
    finishR = true;
    colR = fadeR;
    }
  colG = parseInt("0x"+nowColor.substring(3,5));
  fadeG = parseInt("0x"+fadeColor.substring(3,5));
  f = (Math.abs(colG-fadeG) > 10)?10:1;
  if (colG>fadeG) colG-=f; else if (colG<fadeG) colG+=f; else {
    finishG = true;
    colG = fadeG;
    }
  colB = parseInt("0x"+nowColor.substring(5,7));
  fadeB = parseInt("0x"+fadeColor.substring(5,7));
  f = (Math.abs(colB-fadeB) > 10)?10:1;
  if (colB>fadeB) colB-=f; else if (colB<fadeB) colB+=f; else {
    finishB = true;
    colB = fadeB;
    }

  colR = new String(toHex(colR));
  colG = new String(toHex(colG));
  colB = new String(toHex(colB));
  
  nowColor = "#"+colR+colG+colB;
  document.body.style.backgroundColor = nowColor;
  
  if (finishR && finishG && finishB) {
    self.location = "page.asp?id="+fadeUrl;
    }
  else {
    total++;
    colorTimer = window.setTimeout('realFade()',5);
    }
  }

function toHex(decimal) {
  factor = 256;
  hex = '';
  
  while ((decimal/factor) < 1) {
    hex += '0';
    factor /= 16;
    }
  hex = hex.substring(1,hex.length);
  restant = decimal;
  
  while (factor >=1) {
    getal = Math.floor(restant/factor);
    restant -= (getal*factor);
  
    if (getal<10) hex += getal+'';
    if (getal == 10) hex += 'a';
    if (getal == 11) hex += 'b';
    if (getal == 12) hex += 'c';
    if (getal == 13) hex += 'd';
    if (getal == 14) hex += 'e';
    if (getal == 15) hex += 'f';
  
    factor /= 16;
    }
  
  return (hex);
  }
  
function showqj(n) {
  formElement = self.document.forms["nav"].elements["qJ"];
  formElement.value = n;
  }
  
function restoreqj() {
  formElement = self.document.forms["nav"].elements["qJ"];
  formElement.options[0].selected = true;
  }
  
function checkForm(form) {
  for (var i=0;i<form.elements.length;i++) {
    if (form.elements[i].name=="$naam$" && form.elements[i].value=="") {
      alert("Naam moet ingevuld zijn");
      return false;
      }
    if (form.elements[i].name=="$from$" && (
        (""+form.elements[i].value).indexOf("@")<0 ||
        (""+form.elements[i].value).indexOf(".")<0)) {
      alert("Email adres moet ingevuld zijn");
      return false;
      }
    }
  return true;
  }
  
function quickJump(n,q,s) { 
  if (quickJump.arguments.length>0) {
    formElement = self.document.forms[n].elements[q];
    url = formElement.options[formElement.selectedIndex].value;
    }
  if (url != "") {
    self.location = (s == "true")?(url+".html"):("page.asp?id="+url);
    }
  }
  
function stripEnd(s) {
  while ((s.charAt(s.length-1) == " ") || (s.charAt(s.length-1) == ".")) s = s.substring(0,s.length-2);
  return s;
  }
  
function checkTrefwoord() {
  theTerm = document.forms["zoeken"].elements["zoekterm"].value;
  if (theTerm.length<3) return;
  else {
    while (document.forms["zoeken"].elements["trefwoorden"].options.length>0) document.forms["zoeken"].elements["trefwoorden"].remove(document.forms["zoeken"].elements["trefwoorden"].options[0]);
    for (var i=0; i<anchors.length-1; i+=2) {
      whichOne = -1;
      if (anchors[i].substring(0,theTerm.length).toLowerCase() == stripEnd(theTerm.toLowerCase())) {
        for (var j=0; j<document.forms["zoeken"].elements["trefwoorden"].options.length; j++) {
          m = document.forms["zoeken"].elements["trefwoorden"].options[j].text.toLowerCase();
          m = (m.indexOf(" (",0) != -1)?m.substring(0,m.indexOf(" (",0)):m;
          if (stripEnd(anchors[i].toLowerCase()) == stripEnd(m)) {
            whichOne = j;
            }
          }
        if (whichOne == -1) {
          newOpt = document.createElement("OPTION");
          newOpt.text = anchors[i];
          newOpt.value = anchors[i+1];
          document.forms["zoeken"].elements["trefwoorden"].add(newOpt);
          }
        else {
          m = document.forms["zoeken"].elements["trefwoorden"].options[whichOne].text.toLowerCase();
          if (m.indexOf(" (",0) != -1) {
            c = parseInt(m.substring(m.indexOf(" (",0)+2,m.indexOf(")",m.indexOf(" (",0))));
            c ++;
            m = m.substring(0,m.indexOf(" (",0));
            document.forms["zoeken"].elements["trefwoorden"].options[whichOne].text = m + ' (' + c + ')';
            }
          else {
            document.forms["zoeken"].elements["trefwoorden"].options[whichOne].text = m + ' (2)';
            }
          }
        }
      }
    }
  }
  
function goTrefwoord(t) {
  if (document.forms["zoeken"].elements["trefwoorden"].options.length == 0) return;
  else if (document.forms["zoeken"].elements["trefwoorden"].options.selectedIndex == -1) return;
  else if (document.forms["zoeken"].elements["trefwoorden"].options[document.forms["zoeken"].elements["trefwoorden"].options.selectedIndex].text.indexOf(" (",0) == -1) {
    goId = document.forms["zoeken"].elements["trefwoorden"].options[document.forms["zoeken"].elements["trefwoorden"].options.selectedIndex].value;
    self.location.href = "page.asp?id="+goId+((t)?'&tekst=true':'');
    }
  else {
    m = document.forms["zoeken"].elements["trefwoorden"].options[document.forms["zoeken"].elements["trefwoorden"].options.selectedIndex].text;
    m = (m.indexOf(" (",0) != -1)?m.substring(0,m.indexOf(" (",0)):m;
    document.forms["zoeken"].elements["zoekterm"].value = m;
    document.forms["zoeken"].elements["submit"].click();
    }
  }