// statusregel a hrefs onderdrukken en disable select
function LeegStatus() { 
  for ( var count = 0 ; count < document.links.length; count++ ) {
    document.links[count].onmouseover = StatusTekst ;
    document.links[count].onmouseout = BlancoStatus ;
  }
  document.onselectstart = function() {return false;} // ie
  document.onmousedown = function() {return false;} // mozilla
}
// statusregel a hrefs onderdrukken en select enabled
function StatusLeeg() { 
  for ( var count = 0 ; count < document.links.length; count++ ) {
    document.links[count].onmouseover = StatusTekst ;
    document.links[count].onmouseout = BlancoStatus ;
  }
}
// statusregel legen 
function BlancoStatus() { window.status = "" ; return true ; } 
// inhoud van de link op de statusregel zetten
function StatusTekst(evt) { 
  if (navigator.appName=="Microsoft Internet Explorer") {
    window.status = this.innerText;return true ;
  }
  else {
    window.status = evt.target.innerHTML;return true ; 
  }
}  
// koptekst van logo met verwijzing naar homepage
function Koptekst() { 
  if (top.location == location) {
    // reopen document in frame except for pda's
    if (screen.width>700) {this.location.href = '\/StartFramed?Readform&amp;' + location.pathname;}
  }
  else {
    top.document.title = document.title
  }
}
/* open document in nieuw venster */
function Toon(docid) {
  window.open('/0\/'+docid,'afbeelding','width=400,height=400,top=200,left=200,resizable,toolbar,scrollbars')
}
/* teruggeven cookie-waarde */
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
/* teruggeven specifieke cookie-waarde */
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function accentueerTermen(bodyText, zoekTerm) 
{
  var newText = "";
  var i = -1;
  var lczoekTerm = zoekTerm.toLowerCase();
  var lcBodyText = bodyText.toLowerCase();
    
  while (bodyText.length > 0) {
    i = lcBodyText.indexOf(lczoekTerm, i+1);
    if (i < 0) {
      newText += bodyText;
      bodyText = "";
    } else {
      // skip anything inside an HTML tag
      if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {
        // skip anything inside a <script> block
        if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {
          newText += bodyText.substring(0, i) + startTag + bodyText.substr(i, zoekTerm.length) + endTag;
          bodyText = bodyText.substr(i + zoekTerm.length);
          lcBodyText = bodyText.toLowerCase();
          i = -1;
        }
      }
    }
  }
  
  return newText;
}
var startTag = '<span class="accent">';
var endTag = '</span>';
function accentueer(zoekText)
{
  var zoekArray = zoekText.split(" ");
  
  if (top.location == location) {
    return false;
  }
  if (!document.body || typeof(document.body.innerHTML) == "undefined") {
    return false;
  }
  
  var bodyText = document.body.innerHTML;
  for (var i = 0; i < zoekArray.length; i++) {
    bodyText = accentueerTermen(bodyText, zoekArray[i], startTag, endTag);
  }
  
  document.body.innerHTML = bodyText;
  document.cookie = "q=; path=/; expires=Sat, 01-Jan-00 00:00:01 GMT"
  return true;
}
