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 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.michelkuipers.nl";
var usp_text0 = new Array(); //default text in usp table
usp_text0[0] = "";
var visitordata = new Cookie(document, "sitegen_michel",240);
// when testing bodyHeight function:
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;
}
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 = document.getElementById(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 = document.getElementById("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 = document.getElementById("leftpart");
    if (d == null)
         d = document.getElementById("body0");
    if (d == null) {
    alert("no such id: leftpart or body0");
    return;
    }
    d.style.height = height;
    d = document.getElementById("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 = document.getElementById(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 = "margin: " + q + " " + 2*p + " " + q + " 0;"
//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 = document.getElementById("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 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 = document.getElementById(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 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 < 10 && 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;
    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]);
    }
    // ines: tekst weghalen, alleen op wide!!!
    //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;
// w('<p>'+comment+'</p>');
    w('<table class="inbody" border="0" cellpadding="0" cellspacing="0" width="100%">');
    var classPart = '" class="photopage">';
    if (PhotopageId)
        classPart = '" class="' + PhotopageId + '">'
    for (var i=0; i<L; i++) {
        //ines geen ruimte erboven:
        if (i > 0)
            w('<tr><td height=10></td></tr>');
            // naast elkaar!!
            // altijd (eventueel lege) tekst:
            // eventueel test:' dw:' + dw + ' mw: ' + mw + ' wide: ' + wide +
            w('<tr>');
            if (Pic[i] != "") {
                 w('<td class="ibpright" align="left">');
                 w('<img src="'+Pic[i]+'" width="' + Width[i]+
                      '" height="'+Height[i]+'" alt="' + AltText[i]+ classPart);
                 w('</td>');
            }
            else {
                w('<td></td>');
            }
            w('</tr>');
        }
    // geen extra lege regel aan einde:
    //w('<tr><td height=10></td></tr>')
    w('</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);
    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 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 = document.getElementById(id);
if (d === null) {
    alert("no such id: "+id);
    return;
}
d.style.display = "inline";
d = document.getElementById(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 = document.getElementById("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 = document.getElementById(idnum+'t');
tfield.className = "tduspsb";
var e=document.getElementById(idnum+'h');
var f=document.getElementById('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 = document.getElementById(idnum+'t');
tfield.className = "tduspsa";
var e=document.getElementById(idnum+'h');
var f=document.getElementById('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 = document.getElementById('tduspe');
//put element in e cell:
copyArrayToElement(last_element, efield);
//alert("extra"+efield);
if (last_active_element != "") {
    var tfield = document.getElementById(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::
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!!");
}
}
}
}
zSelectBackgroundImage()

