var BGHeights = new Array();
var BGWidths = new Array();
var BackgroundImages = new Array();
var BackgroundNames = new Array();
var bodyHeightSubtract = 0;
var isIE = (navigator.appName == "Microsoft Internet Explorer");
var isLoaded = 0;
var isNetscape = (navigator.appName == "Netscape");
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var last_active_element = "";
var last_element = new Array(); //content in usp table
last_element[0] = "";
var prevHeight = 0;
var prevWidth = 0;
var siteUrl = "http://www.watervlo.nl";
var usp_text0 = new Array(); //default text in usp table
usp_text0[0] = "";
var visitordata = new Cookie(document, "sitegen_watervlo",240);
// when testing bodyHeight function:
function $id(id) {return document.getElementById(id)}
function $name(name) {return document.getElementsByName(name)}
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?');
  else
    return src + ext;
}
function AC_FL_RunContent(){
  var ret =
    AC_GetArgs
    ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
    //alert(arguments)
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_Generateobj(objAttrs, params, embedAttrs)
{
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }
//alert(str);
  document.write(str);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();
    switch (currArg){
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace":
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
function AC_SW_RunContent(){
  var ret =
    AC_GetArgs
    ( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function ControlVersion()
{
    var version;
    var axo;
    var e;
    // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
    try {
        // version will be set for 7.X or greater players
        axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
        version = axo.GetVariable("$version");
    } catch (e) {
    }
    if (!version)
    {
        try {
            // version will be set for 6.X players only
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
            // installed player is some revision of 6.0
            // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
            // so we have to be careful.
            // default to the first public version
            version = "WIN 6,0,21,0";
            // throws if AllowScripAccess does not exist (introduced in 6.0r47)
            axo.AllowScriptAccess = "always";
            // safe to call for 6.0r47 or greater
            version = axo.GetVariable("$version");
        } catch (e) {
        }
    }
    if (!version)
    {
        try {
            // version will be set for 4.X or 5.X player
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
            version = axo.GetVariable("$version");
        } catch (e) {
        }
    }
    if (!version)
    {
        try {
            // version will be set for 3.X player
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
            version = "WIN 3,0,18,0";
        } catch (e) {
        }
    }
    if (!version)
    {
        try {
            // version will be set for 2.X player
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
            version = "WIN 2,0,0,11";
        } catch (e) {
            version = -1;
        }
    }
    return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function Cookie(document, name, hours, path, domain, secure) {
    this.$document = document;
    this.$name = name;
    if (hours)
        this.$expiration = new Date((new Date()).getTime() + hours*3600000);
    else this.$expiration = null;
    if (path) this.$path = path; else this.$path = null;
    if (domain) this.$domain = domain; else this.$domain = null;
    if (secure) this.$secure = true; else this.$secure = false;
}
Cookie.prototype.load = function() {
    var allcookies = this.$document.cookie;
    if (allcookies == "") return false;
    var start = allcookies.indexOf(this.$name + '=');
    if (start == -1) return false; // Cookie not defined for this page.
    start += this.$name.length + 1; // Skip name and equals sign.
    var end = allcookies.indexOf(';', start);
    if (end == -1) end = allcookies.length;
    var cookieval = allcookies.substring(start, end);
    var a = cookieval.split('&'); // Break it into array of name/value pairs.
    for(var i=0; i < a.length; i++) // Break each pair into an array.
        a[i] = a[i].split(':');
    for(var i = 0; i < a.length; i++) {
        this[a[i][0]] = unescape(a[i][1]);
    }
    return true;
}
Cookie.prototype.remove = function() {
    var cookie;
    cookie = this.$name + '=';
    if (this.$path) cookie += '; path=' + this.$path;
    if (this.$domain) cookie += '; domain=' + this.$domain;
    cookie += '; expires=Fri, 02-Jan-1970 00:00:00 GMT';
    this.$document.cookie = cookie;
}
Cookie.prototype.store = function () {
    var cookieval = "";
    for(var prop in this) {
        // Ignore properties with names that begin with '$' and also methods.
        if ((prop.charAt(0) == '$') || ((typeof this[prop]) == 'function'))
            continue;
        if (cookieval != "") cookieval += '&';
        cookieval += prop + ':' + escape(this[prop]);
    }
    // Now that we have the value of the cookie, put together the
    // complete cookie string, which includes the name and the various
    // attributes specified when the Cookie object was created.
    var cookie = this.$name + '=' + cookieval;
    if (this.$expiration)
        cookie += '; expires=' + this.$expiration.toGMTString();
    if (this.$path) cookie += '; path=' + this.$path;
    if (this.$domain) cookie += '; domain=' + this.$domain;
    if (this.$secure) cookie += '; secure';
    this.$document.cookie = cookie;
}
//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2008 Adobe Systems Incorporated. All rights reserved.
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
    versionStr = GetSwfVer();
    if (versionStr == -1 ) {
        return false;
    } else if (versionStr != 0) {
        if(isIE && isWin && !isOpera) {
            // Given "WIN 2,0,0,11"
            tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
            tempString = tempArray[1]; // "2,0,0,11"
            versionArray = tempString.split(","); // ['2', '0', '0', '11']
        } else {
            versionArray = versionStr.split(".");
        }
        var versionMajor = versionArray[0];
        var versionMinor = versionArray[1];
        var versionRevision = versionArray[2];
            // is the major.revision >= requested major.revision AND the minor version >= requested minor
        if (versionMajor > parseFloat(reqMajorVer)) {
            return true;
        } else if (versionMajor == parseFloat(reqMajorVer)) {
            if (versionMinor > parseFloat(reqMinorVer))
                return true;
            else if (versionMinor == parseFloat(reqMinorVer)) {
                if (versionRevision >= parseFloat(reqRevision))
                    return true;
            }
        }
        return false;
    }
}
function GetSwfVer(){
    // NS/Opera version >= 3 check for Flash plugin in plugin array
    var flashVer = -1;
    if (navigator.plugins != null && navigator.plugins.length > 0) {
        if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
            var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
            var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
            var descArray = flashDescription.split(" ");
            var tempArrayMajor = descArray[2].split(".");
            var versionMajor = tempArrayMajor[0];
            var versionMinor = tempArrayMajor[1];
            var versionRevision = descArray[3];
            if (versionRevision == "") {
                versionRevision = descArray[4];
            }
            if (versionRevision[0] == "d") {
                versionRevision = versionRevision.substring(1);
            } else if (versionRevision[0] == "r") {
                versionRevision = versionRevision.substring(1);
                if (versionRevision.indexOf("d") > 0) {
                    versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
                }
            }
            var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
        }
    }
    // MSN/WebTV 2.6 supports Flash 4
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
    // WebTV 2.5 supports Flash 3
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
    // older WebTV supports Flash 2
    else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
    else if ( isIE && isWin && !isOpera ) {
        flashVer = ControlVersion();
    }
    return flashVer;
}
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function adjustindexmenuright(){return;}
function adjustpicmenuright(subtract, totpics, numspaces) {
// do at changing size also on load (through onResizeFunctions)
// adjusts spacing between pic menu right pictures, like bodyHeight...
    var height = 0;
    var spacing = 5;
    var dh = document.body.clientHeight;
    var totalSubtract = subtract + totpics;
    if (totalSubtract > 0 && dh > totalSubtract ) {
        var height = dh - totalSubtract;
        if (isNetscape)
            height += 15;
        if (height > 20) {
             var spacing = parseInt(height/(numspaces+2));
        }
    }
 //alert("spacing: "+spacing);
    for (var i=0; i<=numspaces; i++) {
        var id = "picmenuspacer" + i;
       var picEl = $id(id);
       picEl.style.height = spacing;
    }
}
function afterLoad() {
//records isLoaded and does onResize()
isLoaded = 1;
onLoadFunctions();
onResize();
}
function backgroundimage() {
// for setting the background image when resizing, called from onresize event
   if (!isLoaded) return;
   var picnum = getPicNum();
// var body0 = $id("bodybody");
// screen only!!
var selector = "#bodybody";
var declaration = "background-image:url("+BackgroundNames[picnum]+")";
var i = picnum;
if (BackgroundImages[i] == null) {
    BackgroundImages[i] = new Image(BGWidths[i], BGHeights[i]);
    BackgroundImages[i].src = BackgroundNames[i];
}
setCssStyleScreenOnly(selector, declaration);
var firstTime = 1;
//if (!isIE) {
//// load cookie data and put back if declaration changed (window size changed, or new)
//visitordata.load();
//if (visitordata.lastbackgroundselector != selector || visitordata.lastbackgrounddeclaration != declaration) {
// firstTime = 1;
// visitordata.lastbackgroundselector = selector;
// visitordata.lastbackgrounddeclaration = declaration;
// visitordata.store();
//}
//else
// firstTime = 0;
//}
//declaration = "background-color: white";
//setCssStyleScreenOnly(selector, declaration);
//if (firstTime) {
// fill the preload images (except picNum, which is already loaded above):
// for (i=0; i<nBGImages; i++) {
// if (BackgroundImages[i] == null && i != picnum) {
// BackgroundImages[i] = new Image(BGWidths[i], BGHeights[i]);
// BackgroundImages[i].src = BackgroundNames[i];
// }
// }
// }
}
function backgroundimageoptions(key, value) {
 // take 'body' selector, put in setCssStyleOnly tag
var selector = "body";
var declaration = key + ":" + value;
setCssStyleScreenOnly(selector, declaration);
}
function bodyHeight(subtract) {
// do at changing size also on load (through onResizeFunctions)
// expecting a div with id "body0" setting at height minus "subtract":
// or a "leftpart" (only IE); with Netscape 15 more
    bodyHeightSubtract = subtract;
    var height = 0;
    var dh = document.body.clientHeight;
    if (subtract > 0 && dh > subtract) {
    var height = dh - subtract;
    if (isNetscape)
        height += 1;
    }
    else
    var d = null;
    if (isNetscape)
        var d = $id("leftpart");
    if (d == null)
         d = $id("body0");
    if (d == null) {
    alert("no such id: leftpart or body0");
    return;
    }
    d.style.height = height;
    d = $id("body0");
}
function bodyHeightTest(subtract) {
// do at changing size also on load (through onResizeFunctions)
// expecting a div with id "body0" setting at height minus "subtract":
// or a "leftpart" (only IE); with Netscape 15 more
    var height = 0;
    var dh = document.body.clientHeight;
    var t = prompt("subtract is nu: " + bodyHeightSubtract + ", geef nieuwe:", subtract);
    var substract = parseInt(t);
    if (substract <= 0)
         return;
    bodyHeight(subtract);
    }
function changeSize(frameName, Width, Height, minWPadding, minHPadding, scale) {
// do at changing size also on load
// expecting a div with id "frameName":
var dw = parseInt(document.body.clientWidth*scale);
//alert("clientWidth: " + document.body.clientWidth + " scale:" + scale + " dw: " + dw);
var d = $id(frameName);
if (d == undefined) {
    alert("no such id: frame");
    return;
}
var p = String(minWPadding);
var q = String(minHPadding);
if (Width > 0 && dw > Width)
   var p = String(Math.max(minWPadding, parseInt((dw-Width)/2)));
//alert("dw: " + dw + "Width:" + Width + " p:" + p);
var dh = document.body.clientHeight;
if (Height > 0 && dh > Height)
   var q= String(Math.max(minHPadding, parseInt((dh-Height)/2)));
//style_node.appendChild(document.createTextNode(
var selector = "#" + frameName;
//ines: margin en alleen aan rechterkant:
var declaration = "padding: " + q + " " + p + " " + q + " " + p + ";"
//alert ("decl: " + declaration);
setCssStyleScreenOnly(selector, declaration);
}
function copyArrayToElement(fromArray, toElement) {
    //first empty element
    while (toElement.hasChildNodes()) {
        toElement.removeChild(toElement.lastChild);
    }
    for (var i = 0; i<fromArray.length; i++)
        if (fromArray[i] != "")
               toElement.appendChild(fromArray[i]);
}
function copyElementToArray(fromElement, toArray) {
    var kids = fromElement.childNodes;
    var numkids = kids.length;
    for (var i = 0; i<toArray.length; i++)
        toArray[i] = "";
    for (var i=0; i<numkids; i++) {
        var clone = kids[i].cloneNode(true);
    //alert("i:"+i+ " clone:"+clone);
        toArray[i] = clone;
        }
}
function doReload() {
    //reloads if height or width changed more than 10 pixels
var dw = document.body.clientWidth;
var dh = document.body.clientHeight;
var deltax = Math.abs(prevWidth-dw);
var deltay = Math.abs(prevHeight-dh);
if (deltax < 10 && deltay < 50)
    return;
document.location.href = document.location.href;
}
function explodedimage() {
// for setting the background image when resizing, called from onresize event
    if (!isLoaded) return;
   var picnum = getPicExplodedNum();
   var body0 = $id("body0");
   body0.style.backgroundImage = "url("+BackgroundNames[picnum]+")";
   body0.style.backgroundPosition = "center center";
   body0.style.backgroundRepeat = "no-repeat";
    var dw = document.body.clientWidth;
      var dh = document.body.clientHeight;
    body0.style.backgroundSize = "20%";
    for (i=0; i<nBGImages; i++) {
    if (BackgroundImages[i] == null) {
        BackgroundImages[i] = new Image(BGWidths[i], BGHeights[i]);
        BackgroundImages[i].src = BackgroundNames[i];
    }
    }
}
function flash_RunContent(moviename) {
    var dw = document.body.clientWidth;
    var dh = document.body.clientHeight;
    dw = parseInt(dw*0.98);
    dh = dh - 30; // allow for header
    if (dw > dh * 1.5) {
    //alert('height: '+ dh);
    dw = parseInt(dh*1.5);
    }
    else {
    //alert('width: ' + dw);
        dh = parseInt(dw/1.5);
    }
     //alert('set w: '+dw + ' h: '+ dh);
    AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
        'width', dw,
        'height', dh,
        'src', moviename,
        'quality', 'medium',
        'pluginspage', 'http://www.adobe.com/go/getflashplayer',
        'align', 'middle',
        'play', 'true',
        'loop', 'true',
        'scale', 'showall',
        'wmode', 'window',
        'devicefont', 'false',
        'id', moviename,
        'bgcolor', '#22bbff',
        'name', moviename,
        'menu', 'true',
        'allowFullScreen', 'false',
        'allowScriptAccess','sameDomain',
        'movie', moviename,
        'salign', ''
        ); //end AC code
}
function flashtest(filename) {
    var dw = document.body.clientWidth;
    var dh = document.body.clientHeight-230;
w('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550");height="400" id="'+filename+'" align="middle">');
w('<param name="allowScriptAccess" value="sameDomain" />');
w('<param name="movie" value="'+filename+'.swf" />');
w('<param name="quality" value="high" />');
w('<param name="bgcolor" value="#000000" />');
w('<embed src="'+filename+'.swf" quality="high" bgcolor="#ffffff" width="'+dw+'" height="'+dh+'" name="'+filename+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
w('</object>');
}
function getPicExplodedNum() {
    // get picture number based on the sizes of the screen
    // picture must fit horizontal and vertical!!
    var dw = document.body.clientWidth;
    var dh = document.body.clientHeight;
    dh = dh -100; // allow for header
    var p = -1;
    for (i=nBGImages-1; i>=0; i--) {
  // alert("i:"+i+" dh, height:"+dh+" "+BGHeights[i]+" dw,width:"+dw+ " "+BGWidths[i]);
    if (BGHeights[i] < dh && BGWidths[i]< dw)
        return i;
    }
    return 0;
}
function getPicNum() {
    // get picture number based on the sizes of the screen
    var dw = document.body.clientWidth;
    var dh = document.body.clientHeight;
    var p = -1;
    // factorY groter, portret groter
    // factorY kleiner portret kleiner, zet in python
    if (!factorX && !factorY) {
        alert ("getPicNum, factorX en factorY beiden false");
        return;
    }
    for (var i=0; i<nBGImages; i++) {
       if (factorY && BGHeights[i] >= dh*factorY) {
        var firstI = i;
        break;
      }
       if (factorX && BGWidths[i] >= dw*factorX) {
        var firstI = i;
        break;
      }
    }
    if (i == nBGImages)
         return i-1;
    if (!doWide)
        return firstI; // no wide...
    // see if width OK:
    foundH = BGHeights[firstI];
    foundW = BGWidths[firstI];
    if (foundW >= dw)
        return firstI;
    // if checking for Y, take
    if (factorY) {
        //screen wider than image, look further:
        for (i=firstI+1; i<nBGImages; i++) {
             if (BGHeights[i] == foundH)
                 return i;
         }
         return nBGImages-1;
    }
    if (factorX) {
          for (i=firstI+1; i<nBGImages; i++) {
              if (BGWidths[i] >= dw*factorX)
                    return i;
         }
        return nBGImages-1;
    }
}
function getSize(w) {
  var myWidth = 0, myHeight = 0;
  if( typeof( w.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = w.innerWidth;
    myHeight = w.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return Array(myWidth, myHeight);
}
function hello() {
    var win = window._content.top;
    var doc = win.document;
    var Frames = win.frames;
    var t = "";
    alert("hello");
    if (Frames.length > 0) {
        alert("frames:" + Frames.length);
        t = 'Frames:'
        for (var f in Frames)
            t += "\n"+f.document.name;
        alert(t);
    }
    else {
        t = "location:"+win.location+"\ndocument:"+doc.title;
        alert(t);
    }
}
function hideMore(id) {
    //at start of page, hide the Lees verder part
var d = $id(id);
if (d === null) {
    alert("no such id: "+id);
    return;
}
d.style.display = "none";
}
function indexmenu(Pic, Width, Height, Cl, Link, Text, Additional, Scale) {
    var L = Pic.length;
    var mw = 0;
    var paddingFactor = 0.98;
    for (var i=0; i<L; i++) {
        mw = Math.max(mw, Width[i]);
    }
    //width times Scale, that accounts for leftMenuWidth times
    //paddingFactor (above) which accounts for padding.
    var dw = document.body.clientWidth*Scale*paddingFactor;
    var nCol = Math.min(parseInt(dw/(mw+10)), L);
    e = '<table class="picmenu" border="0" cellpadding="0" cellspacing="0" width="100%">';
    w(e);
    w('<tr><td height="10"><td></tr><tr>');
    var al = "center";
    var im = '';
    var li = '';
    var validCol = 0; // in case of empty columns
    for (var i=0; i<L; i++) {
        if (validCol%nCol == 0 && validCol > 0) {
            w('</tr><tr><td height="10"><td></tr><tr>');
        }
        if (Pic[i] != "") {
             im = '<img src="'+Pic[i]+'" width="' + Width[i]+
                      '" height="'+Height[i]+'" alt="' + Text[i] +
                     '" class="indexmenu">';
        }
        else {
// geen entry als geen plaatje
// im = Text[i];
            continue;
        }
        validCol++;
        if (Link[i] != "" && im != "") {
            li = '<a href="'+ Link[i] + '">' + im + '</a>';
        }
        else {
            li = im;
        }
        var textLink = '<a href="'+ Link[i] + '">' + Text[i] + "</a>";
      // if (Pic[i] == "" && Additional[i] != "")
      // li = li + "<br>"+Additional[i];
      // hier ook de link als text:
      // li = li + "<br>" + textLink;
        w('<td class="' + Cl[i] + '" align="' +
                        'center' + '">' + li + '</td>');
    }
    w('</tr><tr><td height="10"><td></tr></table>');
}
function indexmenucount(Pic, Width, Height, Cl, Link, Text, Additional, Count, Scale) {
    var L = Pic.length;
    var mw = 0;
    var paddingFactor = 0.98;
    for (var i=0; i<L; i++) {
        mw = Math.max(mw, Width[i]);
    }
    //width times Scale, that accounts for leftMenuWidth times
    //paddingFactor (above) which accounts for padding.
    var dw = document.body.clientWidth*Scale*paddingFactor;
    var nCol = Math.min(parseInt(dw/(mw+10)), L);
    e = '<table class="picmenu" border="0" cellpadding="0" cellspacing="0" width="100%">';
    w(e);
    w('<tr><td height="10"><td></tr><tr>');
    var al = "center";
    var im = '';
    var li = '';
    for (var i=0; i<L; i++) {
        if (i%nCol == 0 && i > 0) {
        w('</tr><tr><td height="10"><td></tr><tr>');
        }
        if (Pic[i] != "") {
             im = '<img src="'+Pic[i]+'" width="' + Width[i]+
                      '" height="'+Height[i]+'" alt="' + Text[i] +
                     '">';
        }
        else {
            im = Text[i];
        }
        if (Link[i] != "") {
            li = '<a href="'+ Link[i] + '">' + im + '</a>';
        }
        else {
            li = im;
        }
        if (Pic[i] == "" && Additional[i] != "")
            li = li + "<br>"+Additional[i];
        if (Count[i] > 1)
            li = li + '&nbsp;('+Count[i]+')';
        w('<td class="' + Cl[i] + '" align="' +
                        'center' + '">' + li + '</td>');
    }
    w('</tr><tr><td height="10"><td></tr></table>');
}
function loadfirstbackgroundimage(Name, Width, Height) {
    // declare the pictures and preload the first with the right size
    nBGImages = Name.length;
    for (i=0; i<nBGImages; i++) {
    BackgroundNames[i] = Name[i];
    BGWidths[i] = Width[i];
    BGHeights[i] = Height[i];
    BackgroundImages[i] = null;
    }
    var picnum = getPicNum();
    if (BackgroundImages[picnum] == null) {
    BackgroundImages[picnum] = new Image(BGWidths[picnum], BGHeights[picnum]);
    BackgroundImages[picnum].src = BackgroundNames[picnum];
    }
}
function loadfirstexplodedimage(Name, Width, Height) {
    // declare the pictures and preload the first with the right size
    nBGImages = Name.length;
    for (i=0; i<nBGImages; i++) {
    BackgroundNames[i] = Name[i];
    BGWidths[i] = Width[i];
    BGHeights[i] = Height[i];
    BackgroundImages[i] = null;
    }
    var picnum = getPicExplodedNum();
    if (BackgroundImages[picnum] == null) {
    BackgroundImages[picnum] = new Image(BGWidths[picnum], BGHeights[picnum]);
    BackgroundImages[picnum].src = BackgroundNames[picnum];
}
    //style of body0: if
        catchEvents();
        catchKeys();
        disableClipboard();
        explodedImage = 1;
}
function m(a, b, s, t) {
var mm;mm='<a href="';mm=mm+'mailto';mm+=":"+b;mm+="@"+a;
if(s){mm+="?subj";mm+="ect="+s};mm+='">';
if(t)mm=mm+t;else mm=mm+b+"@"+a;mm+="</a>";w(mm);
}
function onResize() {
    //acts if height or width changed more than 10 pixels
    if (!isLoaded) return;
    var dw = document.body.clientWidth;
    var dh = document.body.clientHeight;
    var deltax = Math.abs(prevWidth-dw);
    var deltay = Math.abs(prevHeight-dh);
    if (deltax < 20 && deltay < 50)
    return;
    prevHeight=dh;
    prevWidth=dw;
    onResizeFunctions();
}
function onResizeReload() {
    //reloads if height or width changed more than 10 pixels
    if (!isLoaded) return;
    var dw = document.body.clientWidth;
    var dh = document.body.clientHeight;
    var deltax = Math.abs(prevWidth-dw);
    var deltay = Math.abs(prevHeight-dh);
    if (deltax < 25 && deltay < 50)
    return;
  // alert("onresizereload");
    document.location.href = document.location.href;
}
function photopage(Text, Pic, Width, Height, AltText, Scale, SplitAt) {
    var L = Pic.length;
    var mw = 0;
    var padding = 20;
    for (var i=0; i<L; i++) {
        mw = Math.max(mw, Width[i]);
    }
    //width times Scale, that accounts for leftMenuWidth times
    //paddingFactor (above) which accounts for padding.
    var available = document.body.clientWidth*Scale - 2*padding;
    var dw = available*(1.0-SplitAt);
    var wide = 0;
    var leftandright = 0;
    if (dw > mw) wide = 1;
    else {
        if (available > mw)
            leftandright = (available - mw)/2;
    }
// comment = 'wide; ' + wide + ' available: '+available + ' mw: '+ mw + ' leftandright:' + leftandright;
// document.write('<p>'+comment+'</p>');
    document.write('<table class="inbody" border="0" cellpadding="0" cellspacing="0" width="100%">');
    for (var i=0; i<L; i++) {
	if (i)
	    document.write('<tr><td height=10></td></tr>');
        if (wide == 0) {
            // onder elkaar!!
            if (Pic[i] != "") {
                document.write('<tr>');
                 if (leftandright > 0)
                     document.write('<td width="'+leftandright+'"></td>');
                document.write('<td class="ibpbottom" align="left">');
                document.write('<img src="'+Pic[i]+'" width="' + Width[i]+
                      '" height="'+Height[i]+'" alt="' + AltText[i]+
                     '">');
                document.write('</td>');
                 if (leftandright > 0)
                     document.write('<td width="'+leftandright+'"></td>');
                 document.write('</tr>');
            }
            if (Text[i] != "") {
                document.write('<tr>');
                if (leftandright > 0)
                     document.write('<td width="'+leftandright+'"></td>');
                document.write('<td class="ibtop" align="left">' + Text[i]+ '</td></tr>');
                if (leftandright > 0)
                     document.write('<td width="'+leftandright+'"></td>');
                document.write('<tr><td height=10></td></tr>')
            }
        }
        else {
            // naast elkaar!!
            // altijd (eventueel lege) tekst:
            // eventueel test:' dw:' + dw + ' mw: ' + mw + ' wide: ' + wide +
            document.write('<tr>');
            if (Pic[i] != "") {
                 document.write('<td class="ibpright" align="left">');
                 document.write('<img src="'+Pic[i]+'" width="' + Width[i]+
                      '" height="'+Height[i]+'" alt="' + AltText[i]+
                     '">');
                 document.write('</td>');
            }
            else {
                document.write('<td></td>');
            }
            document.write('<td class="ibleft" width="50%">' + Text[i]+'</td>');
            document.write('</tr>');

        }
    }
    document.write('<tr><td height=10></td></tr>')
    document.write('</table>');
}
function picmenu(Pic, Width, Height, Cl, Link, Text) {
    //expect picmenuPrefixForLinkTitle and picmenuWithText and picmenuScale
    // picmenuPaddingFactor as javascript global variables (from HtmlDoc)
    // set in html file.
    var L = Pic.length;
    var mw = 0;
    for (var i=0; i<L; i++) {
        mw = Math.max(mw, Width[i]);
    }
    //width times Scale, that accounts for leftMenuWidth times
    //paddingFactor (above) which accounts for padding.
    var dw = document.body.clientWidth*picmenuScale*picmenuPaddingFactor;
    var nCol = Math.min(parseInt(dw/(mw+10)), L);
    //w*("test picmenu");
    e = '<table class="picmenu" border="0" cellpadding="0" cellspacing="0" width="100%">';
    var spacerRow = '<tr><td height="10"><td></tr>';
    w(e);
    w(spacerRow + '<tr>');
    var al = "center";
    var im = '';
    var li = '';
    var te = '';
    var nValid = 0;
    for (var i=0; i<L; i++) {
        var AltText = Text[i];
        if (picmenuPrefixForLinkTitle)
            AltText = picmenuPrefixForLinkTitle + AltText;
        if (Pic[i]) {
             im = '<img src="'+Pic[i]+'" width="' + Width[i]+
                      '" height="'+Height[i]+'" alt="' + AltText+
                      '" title="' + AltText+
                     '">';
        }
        else {
            im = Text[i];
        }
        if (i%nCol == 0 && i > 0)
            w('</tr>' + spacerRow + '<tr>');
        if (Link[i] != "") {
            li = '<a href="'+ Link[i] + '">' + im + '</a>';
            te = '<a href="'+ Link[i] + '">' + Text[i] + '</a>';
        }
        else {
            li = im;
            te = Text[i];
        }
        if (picmenuWithText)
           // if want texts:
           li = li + '<br>' + te;
        w('<td class="' + Cl[i] + '" align="' +
                        'center' + '" title="'+AltText+'">' + li + '</td>');
    }
    w('</tr>' + spacerRow + '</table>');
}
function prelima(Name, Width, Height) {
    var L = Name.length;
    for (var i=0; i<L; i++) {
        (new Image(Width[i], Height[i])).src = Name[i];
    }
}
function resizeflash(flname) {
    var dw = document.body.clientWidth;
    var dh = document.body.clientHeight;
    dw = parseInt(dw*0.98);
    if (isIE)
    dh = dh - 50; // allow for header
    else
    dh = dh - 30; // allow for header
    if (dw > dh * 1.5) {
    //alert('height: '+ dh);
    dw = parseInt(dh*1.5);
    }
    else {
    //alert('width: ' + dw);
        dh = parseInt(dw/1.5);
    }
var elt = $name(flname)[0];
if (dw != elt.width) elt.width = dw;
if (dh != elt.height) elt.height = dh;
}
zSelectBackgroundImage()
function resizeprint(doResize, language) {
//sizes to convenient format for printing
alert ('doResize: '+doResize);
if (doResize != 1) {
    window.print();
    return;
}
alert('href:'+window.location.href);
var w = window.open(window.location.href, 'Sample', 'width=800,height=600');
w.print();
alert('close againsize:');
w.close();
}
function setCssStyleScreenOnly(selector, declaration) {
// set style for element screen only. declaration WITHOUT braces!!
// example: see changeSize.
if (!isIE) { // firefox:
    var style_node = document.createElement("style");
    style_node.setAttribute("type", "text/css");
    style_node.setAttribute("media", "screen");
    var text = selector + "{" + declaration + "}";
    style_node.appendChild(document.createTextNode(text));
    // append the style node:
    document.getElementsByTagName("head")[0].appendChild(style_node);
}
else { //IE
   if (declaration.indexOf("url(../") >= 0){
    declaration = declaration.replace(/..\//g, "");
   }
   if (document.styleSheets && document.styleSheets.length > 0) {
         var last_style_node = document.styleSheets[document.styleSheets.length - 1];
         if (typeof(last_style_node.addRule) == "object") last_style_node.addRule(selector, declaration);
        }
}
}
function setbackgroundimage(baseoffile, minh, maxh, steph) {
    var b = document.body;
       var dh = b.clientHeight;
       for (h=minh; h <maxh; h += steph) {
       if (dh <= h) {
               var name = baseoffile + h + ".jpg";
                     var bgim = "url(" + '"' + name + '"' + ")";
             // alert ("height: " + dh + " name: " + name + " bgim: " + bgim);
                    b.style.backgroundImage =bgim;
                    return;
            }
        }
           var name = baseoffile + maxh + ".jpg";
             var bgim = "url(" + '"' + name + '"' + ")";
     // alert ("else, height: " + dh + " name: " + name + " bgim: " + bgim);
        b.style.backgroundImage=bgim;
}
function showMore(id) {
    //show Lees verder part hide id+"link"
var d = $id(id);
if (d === null) {
    alert("no such id: "+id);
    return;
}
d.style.display = "inline";
d = $id(id+"link");
if (d === null) {
    return;
}
d.style.display = "none";
}
function sidebarindent(n){
var dh = document.body.clientHeight;
var h = parseInt(n*dh/40);
var d = $id("sidebarindent");
if (d == undefined) {
    alert("no such id: sidebarindent");
    return;
}
d.style.padding = h;
}
function tdhide(idnum) {
//do a (closing) hide by leaving a table usp cell, for tableusp and tableusp2
var tfield = $id(idnum+'t');
tfield.className = "tduspsb";
var e=$id(idnum+'h');
var f=$id('tduspe');
copyArrayToElement(usp_text0, f);
}
function tdshow(idnum) {
//do show in usp table (from tableusp and tableusp2)
if (last_active_element)
    tdhide(last_active_element);
last_active_element = idnum;
var tfield = $id(idnum+'t');
tfield.className = "tduspsa";
var e=$id(idnum+'h');
var f=$id('tduspe');
var toChild = f.lastChild;
// first time copy contents to array:
if (usp_text0.length == 1 && usp_text0[0] == "" && f.hasChildNodes())
    copyElementToArray(f, usp_text0);
//copy contents to last_array:
copyElementToArray(e, last_element);
//put element in e cell:
copyArrayToElement(last_element, f);
}
function tdshowextra(activebutton) {
//do show last content in extra cell
var efield = $id('tduspe');
//put element in e cell:
copyArrayToElement(last_element, efield);
//alert("extra"+efield);
if (last_active_element != "") {
    var tfield = $id(last_active_element+'t');
    tfield.className = "tduspsa";
    }
}
function validateForm(f) {
    var aanaf = "";
    for (var i=0; i < f.length; i++) {
        var e = f.elements[i];
        if (e.type == "radio" && e.checked){
            var aanaf = e.value;
    }
    }
    if (!aanaf) {
        alert("Kies Aanmelden of Afmelden s.v.p.");
        return false;
    }
    aanaf = aanaf.toLowerCase();
  var text = "Er wordt nu (op uw computer) een e-mail gemaakt met uw gegevens.\n\nNadat u deze e-mail hebt verzonden verwerken wij uw aan/afmelding.";
        if (aanaf == "aanmelden")
     var text = "Er wordt nu (op uw computer) een e-mail gemaakt met uw gegevens.\n\nNadat u deze e-mail hebt verzonden hebt u zich aangemeld en ontvangt u onze nieuwsbrieven.";
    if (aanaf == "afmelden")
       var text = "Er wordt nu (op uw computer) een e-mail gemaakt met uw gegevens.\n\nNadat u deze e-mail hebt verzonden schrappen wij u van onze mailinglijst. U kunt zich later altijd weer aanmelden.";
   text = text + "\n\nVriendelijke groet, Jochem en Anna, Bezoekerscentrum De Breek."
   alert(text);
   return true;
}
function w(t) {
    // helper function
    document.write(t);
}
function zSelectBackgroundImage() {
// go right away only for FireFox::
// tijdelijk eruit:
return;
if (!isIE) {
if (visitordata.load()) {
    if (visitordata.lastbackgroundselector && visitordata.lastbackgrounddeclaration) {
    var selector = visitordata.lastbackgroundselector;
    var declaration = visitordata.lastbackgrounddeclaration;
// alert("vorige background selector: " + selector + "Declaration:" + declaration);
    setCssStyleScreenOnly(selector, declaration);
// alert("set previous!!");
}
}
}
}

