/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!$id){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?$id(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!$id&&document.all){$id=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
var BGHeights = new Array();
var BGWidths = new Array();
var BackgroundImages = new Array();
var BackgroundNames = new Array();
var IDees = new Array();
var L = 0;
var TIMER = 0;
var inum = 0;
var isIE = (navigator.appName == "Microsoft Internet Explorer");
var isLoaded = 0;
var isNetscape = (navigator.appName == "Netscape");
var nextTime = 100;
var prevHeight = 0;
var prevWidth = 0;
function $id(x){return document.getElementById(x)};
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 = "body";
var bgName = BackgroundNames[picnum];
if (isIE) {
    // haal ../ weg voor IE:
    bgName = bgName.replace(/\.\.\//g, "");
}
var declaration = "background-image:url("+bgName+")";
//alert("set background image" + declaration);
var i = picnum;
if (BackgroundImages[i] == null) {
    BackgroundImages[i] = new Image(BGWidth[i], BGHeight[i]);
    BackgroundImages[i].src = BGName[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();
//// alert("new cookie data");
//}
//else
//    firstTime = 0;
//}
//declaration = "background-color: black";
//setCssStyleScreenOnly(selector, declaration);
if (firstTime) {
// fill the preload images:
// body0.style.backgroundImage = "url("+BackgroundNames[picnum]+")";
    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
// this version also does variable padding around the body (evers)
    var height = 0;
    var dh = document.body.clientHeight;
    //for variable padding around:
    var dw = document.body.clientWidth;
    if (subtract > 0 && dh > subtract) {
    var height = dh - subtract;
    if (isNetscape)
        height += 15;
    }
    else
    var d = null;
    if (isIE)
    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;
    //alert("dh: " + dh + ", dw: " + dw);
    // make padding variable, een rand rond de body:
    var xpad = parseInt(dw/30);
    var ypad = parseInt(dh/30);
    var aspectRatio = dw/dh;
    if (ypad*aspectRatio > xpad)
        ypad = parseInt(xpad/aspectRatio);
    else
        xpad = parseInt(ypad*aspectRatio);
    xpad = Math.max(xpad, 10);
    ypad = Math.max(ypad, 10);
    var downPad = Math.min(parseInt(ypad/5), 10);
    var Style ="padding: "+ypad+"px "+xpad+"px "+downPad+"px "+xpad+"px;";
    //alert("styleline: " + Style);
    setCssStyleScreenOnly("body", Style);
}
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);
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)));
var dh = document.body.clientHeight;
if (Height > 0 && dh > Height)
   var q= String(Math.max(minHPadding, parseInt((dh-Height)/2)));
d.style.padding = q + " " + p;
}
function decreaseCols(items, cols) {
//try if cols can be lowered
if (cols == 1)
    return 1;
var nRows = Math.floor(items/cols);
if (items%cols)
    nRows++;
do {
    cols--;
    var newRows = Math.floor(items/cols);
    if (items%cols)
        newRows++;
} while (newRows == nRows);
return cols+1;
}
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 fixpngimages() {
    //maakt partiele transparantie van png plaatjes in orde
    //voor foreground plaatjes in IE 5.5 en 6.
    //bron allerlei sites
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version >= 5.5) && (document.body.filters))
{
    //alert("fixpngimages");
     for(var i=0; i<document.images.length; i++)
   {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
         img.outerHTML = strNewHTML
         i = i-1
      }
   }
}
}
function frontimage(name, num) {
   var im = document.images[name];
   var n2 = name+num+'.jpg';
   im.src = n2;
var dw = document.body.clientWidth;
var w = parseInt(dw/3)-5;
im.src = n2;
im.width=w;
im.height=parseInt(w*0.75);
}
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");
        factorX = 1;
        factorY = 1
    }
    for (var i=0; i<nBGImages; i++) {
       if (factorY && BGHeights[i] >= dh*factorY) {
        var firstY = i;
        break;
      }
    }
    for (var j=0; j<nBGImages; j++) {
       if (factorX && BGWidths[j] >= dw*factorX) {
        var firstX = j;
        break;
      }
    }
    var firstI = Math.max(firstX, firstY);
    if (firstI == nBGImages)
         return firstI-1;
    if (!doWide)
        return firstI; // no wide...
    // see if width OK:
    foundH = BGHeights[firstI];
    foundW = BGWidths[firstI];
    if (foundW >= dw)
        return firstI;
    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;
    }
    if (!factorX && !factorY) {
        for (i=firstI+1; i<nBGImages; i++) {
            if (BGHeights[i] == foundH)
                 return i;
         }
         return nBGImages-1;
    }
}
function getPosition(w) {
  var myX = 0, myY = 0;
  if( typeof( w.pageXOffset ) == 'number' ) {
    //Non-IE
    myX = w.pageXOffset;
    myY = w.pageYOffset;
  } else {
    myX = document.body.scrollLeft ;
    myY = document.body.scrollTop ;
  }
  return Array(myX, myY);
}
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 indexmenu(Pic, Width, Height, Cl, Link, Text, Additional, Scale) {
    var L = Pic.length;
    var mw = 0;
    var paddingFactor = 0.95;
    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);
    nCol = decreaseCols(L, nCol);
    var WidthMin = Math.floor(dw/nCol);
    var widthActual = 0
    e = '<table class="indexmenu" border="0" cellpadding="0" cellspacing="0" width="100%">';
    w(e);
    w('<tr>');
    var al = "center";
    var im = '';
    var li = '';
    var firstCol = 0;
    var colorIndex = 0;
    for (var i=0; i<L; i++) {
        if (i%nCol == 0 && i > 0) {
        w('</tr><tr>');
        firstCol = (firstCol+1)%2;
        colorIndex = firstCol;
        }
        if (Link[i] != "")
            li = '<a href="'+ Link[i] + '">' + Text[i] + '</a><br>';
        else
            li = Text[i];
        if (Pic[i] != "") {
             widthActual = Math.max(WidthMin, Width[i]);
             im = '<img src="'+Pic[i]+'" width="' + Width[i] +
                      '" height="'+Height[i]+'" alt="' + Text[i] +
                    '">';
             if (Link[i] != "") {
                im = '<a href="'+ Link[i] + '">' + im + '</a>';
             }
        }
        else {
            widthActual = WidthMin;
            im = "";
        }
        if (Pic[i] == "" && Additional[i] != "")
            li = li + "<br><br>"+Additional[i];
        w('<td class="' + Cl[colorIndex] + '" align="center" width="' +
                widthActual + '">' + im + '</td>');
        colorIndex = (colorIndex + 1)%2;
    }
    while (i%nCol > 0) {
        w('<td class="' + Cl[colorIndex] + '" width="' +
                widthActual + '"</td>');
        i = i+1;
    }
    w('</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="indexmenu" border="0" cellpadding="0" cellspacing="0" width="100%">';
    document.write(e);
    //document.write('<tr><td height="10"><td></tr><tr>');
    var al = "center";
    var im = '';
    var li = '';
    var lit = '';
    var clIndex = -1;
    for (var i=0; i<L; i++) {
        if (i%nCol == 0 && i > 0) {
        document.write('</tr><tr>');
        if (nCol%2 == 0)
            clIndex++;
        }
        if (Pic[i] != "") {
             im = '<img src="'+Pic[i]+'" width="' + Width[i]+
                      '" height="'+Height[i]+'" alt="' + Text[i] +
                     '">';
        }
        else {
            im = Text[i];
        }
        if (Link[i] != "") {
            lit = '<a href="'+ Link[i] + '">' + Text[i] + '</a>';
            li = '<a href="'+ Link[i] + '">' + im + '</a>';
        }
        else {
            lit = Text[i];
            li = im;
        }
        if (Pic[i] == "" && Additional[i] != "")
            lit = lit + "<br>"+Additional[i];
        if (Count[i] > 1)
            lit = lit + '&nbsp;('+Count[i]+')';
        clIndex++;
        if (clIndex >= L) {
            clIndex=L%2;
        }
        document.write('<td class="' + Cl[clIndex] + '" align="' +
                        'center' + '">' + li + '<br>'+lit+'</td>');
    }
    while (i%nCol > 0) {
        clIndex++;
        if (clIndex >= L) {
            clIndex=L%2;
        }
        document.write('<td class="' + Cl[clIndex] + '"</td>');
        i++;
    }
   document.write('</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();
    //alert("picnum: " + picnum + "(total: " + nBGImages);
    if (BackgroundImages[picnum] == null) {
    BackgroundImages[picnum] = new Image(BGWidths[picnum], BGHeights[picnum]);
    BackgroundImages[picnum].src = BackgroundNames[picnum];
    }
}
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 makeallpeople(IDs, Names, Larges, LargeWidths, LargeHeights, Thumbs, ThumbWidths,ThumbHeights,
                       SoftThumbs, SoftThumbWidths, SoftThumbHeights, Scale){
var paddingFactor = 0.9;
var dw = parseInt(document.body.clientWidth*Scale*paddingFactor);
L = IDs.length;
//alert("L: " + L);
inum = L-1;
for (i=0;i<L;i++) {
    IDees[i] = IDs[i];
    var id = IDs[i];
    var img = document.getElementById(id+'image');
    img.src = 'th_s--'+id+'.jpg';
    var txt = document.getElementById(id+'name');
    txt.style.visibility = 'hidden';
    //preload larger picture:
    (new Image(LargeWidths[i], LargeHeights[i])).src = Larges[i];
}
var i = 0;
}
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]);
    }
    //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%">');
    for (var i=0; i<L; i++) {
        w('<tr><td height=10></td></tr>')
        if (wide == 0) {
            // onder elkaar!!
            if (Text[i] != "") {
                w('<tr><td height=10></td></tr>');
                w('<tr>');
                if (leftandright > 0)
                     w('<td width="'+leftandright+'"></td>');
                w('<td class="ibtop" align="left">' + Text[i]+ '</td></tr>');
                if (leftandright > 0)
                     w('<td width="'+leftandright+'"></td>');
                w('<tr><td height=10></td></tr>')
            }
            if (Pic[i] != "") {
                w('<tr>');
                 if (leftandright > 0)
                     w('<td width="'+leftandright+'"></td>');
                w('<td class="ibpbottom" align="left">');
                w('<img src="'+Pic[i]+'" width="' + Width[i]+
                      '" height="'+Height[i]+'" alt="' + AltText[i]+
                     '">');
                w('</td>');
                 if (leftandright > 0)
                     w('<td width="'+leftandright+'"></td>');
                 w('</tr>');
            }
        }
        else {
            // naast elkaar!!
            // altijd (eventueel lege) tekst:
            // eventueel test:' dw:' + dw + ' mw: ' + mw + ' wide: ' + wide +
            w('<tr><td class="ibleft" width="50%">' + Text[i]+'</td>');
            if (Pic[i] != "") {
                 w('<td class="ibpright" align="left">');
                 w('<img src="'+Pic[i]+'" width="' + Width[i]+
                      '" height="'+Height[i]+'" alt="' + AltText[i]+
                     '">');
                 w('</td></tr>');
            }
            else {
                w('<td></td></tr>');
            }
        }
    }
    w('<tr><td height=10></td></tr>')
    w('</table>');
}
function picmenu(Pic, Width, Height, Cl, Link, Text, 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);
    nCol = decreaseCols(L, nCol);
    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;
        }
        w('<td class="' + Cl[i] + '" align="' +
                        'center' + '">' + li + '</td>');
    }
    w('</tr><tr><td height="10"><td></tr></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 randomShow() {
    var id = IDees[inum];
    var img = document.getElementById(id+'image');
    //alert("inum: "+ inum + " id: "+id +" img: " + img);
    //alert("IDees: " + IDees);
    img.src = 'th_s--'+id+'.jpg';
    //inum is global!
    inum = parseInt(Math.random()*L);
    //inum = inum+1;
    if (inum >= L) inum = 0;
    id = IDees[inum];
    var img = document.getElementById(id+'image');
    img.src = 'th_'+id+'.jpg';
    if (nextTime < 2000)
        nextTime = nextTime + 20;
    TIMER = setTimeout("randomShow()", nextTime);
}
function resizeprint(doResize, language) {
//sizes to convenient format for printing
var toX = 800;
var toY = 600;
var posX = 100;
var posY = 100;
alert ('doResize: '+doResize);
if (doResize != 1) {
    window.print();
    return;
}
var oldSize = getSize(window);
var oldPosition = getPosition (window);
alert('position: ' + oldPosition);
window.resizeTo(toX, toY);
window.moveTo(posX, posY);
var newPosition = getPosition (window);
alert('position: ' + newPosition);
var newSize = getSize(window);
var oldX = oldSize[0];
var oldY = oldSize[1];
var newX = newSize[0];
var newY = newSize[1];
window.print();
if (language == "nl")
    var T = "terug naar het vorige venster formaat";
else
    var T = "back to the previous window size" ;
alert(T);
window.resizeTo(toX + oldX-newX, toY+oldY-newY);
newSize = getSize(window);
//alert('old: '+ oldSize +' new:' + newSize);
}
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 startallpeople() {
    TIMER = setTimeout("randomShow()", nextTime);
}
function tdhide(idnum) {
var img = document.getElementById(idnum+'image');
img.src = 'th_s--'+idnum+'.jpg'
var txt = document.getElementById(idnum+'name');
txt.style.visibility = 'hidden';
}
function tdshow(idnum) {
//shows td elements
var img = document.getElementById(idnum+'image');
img.src = idnum+'.jpg'
var txt = document.getElementById(idnum+'name');
txt.style.visibility = 'visible';
clearTimeout(TIMER);
}
function w(t) {
    // helper function
    document.write(t);
}

