// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array. Rememeber
// to increment the theImages[x] index!

theImages[0] = '/_images/image1.gif'
theImages[1] = '/_images/image2.gif'
theImages[2] = '/_images/image3.gif'
theImages[3] = '/_images/image4.gif'
theImages[4] = '/_images/image5.gif'
theImages[5] = '/_images/image6.gif'
theImages[6] = '/_images/image7.gif'

// ======================================
// do not change anything below this line
// ======================================

var j = 0
var p = theImages.length;

var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}

var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'" width="850" height="421">');
}


 
//-------------------------------------------------------------------------------------------//

var image = null;

function ShowFoto(image)
{
  var divwidth    = 600;
  var divheight   = 470;
  var width       = document.body.clientWidth;
  var height      = document.body.clientHeight + document.body.scrollTop;
  var marginleft  = (width - divwidth) / 2;
  var margintop   = (height - divheight) /2;
  var bodywidth	  = document.body.scrollWidth;
  var bodyheight  = document.body.scrollHeight;

  document.getElementById("a_overlay").style.width  = bodywidth;
  if (height > bodyheight)
  {
    document.getElementById("a_overlay").style.height = height;
  }
  else document.getElementById("a_overlay").style.height = bodyheight;

  document.getElementById("showfoto").style.width  = divwidth;
  document.getElementById("showfoto").style.height = divheight;
  document.getElementById("showfoto").style.top    = margintop + (document.body.scrollTop / 2);
  document.getElementById("showfoto").style.left   = marginleft;
  
  var inner = "<img src=\ "+image+"\ onclick=\"HideFoto();\" /><br /><span class=\"sluitfoto\">Klik op de foto om deze af te sluiten</span>"

  document.getElementById("showfoto").innerHTML = inner;
  
  document.getElementById("showfoto").style.display  = "block";
  document.getElementById("a_overlay").style.display  = "block";
}

function HideFoto()
{
  document.getElementById("showfoto").style.display  = "none";
  document.getElementById("a_overlay").style.display  = "none";
}




//-->
