function vergroot(afbeelding,breedte,hoogte){

 backgroundobj = document.getElementById('picturebackground');
 picturepopupobj = document.getElementById('picturepopup');

 var myWidth = 0, myHeight = 0;
 if( typeof( window.innerWidth ) == 'number' ) {
   //Non-IE
   myWidth = window.innerWidth;
   myHeight = window.innerHeight;
   maxHeight = window.innerHeight + window.scrollMaxY;
 } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
  //IE 6+ in 'standards compliant mode'
  myWidth = document.documentElement.clientWidth;
  myHeight = document.documentElement.clientHeight;
  maxHeight = document.documentElement.clientHeight + document.documentElement.scrollHeight;
 } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
  //IE 4 compatible
  myWidth = document.body.clientWidth;
  myHeight = document.body.clientHeight;
  maxHeight = document.body.clientHeight + document.body.scrollHeight;
 }


 var scrolly = (typeof pageYOffset != 'undefined') ? window.pageYOffset : document.documentElement.scrollTop;
 document.getElementById('popupimg').src= '/afbeeldingen/original/' + afbeelding;
 
 backgroundobj.style.width = '100%';
 backgroundobj.style.height = maxHeight + 'px';
 backgroundobj.style.display = 'block';

 picturepopupobj.style.width = breedte + 10 +'px';
 picturepopupobj.style.height = hoogte  + 10 + 'px';
 tophoogte = ((myHeight / 2) - (hoogte / 2)) + scrolly;
 if (tophoogte < 0) tophoogte = 0;
 picturepopupobj.style.top = tophoogte + 'px'; 
 picturepopupobj.style.borderStyle = 'solid';
 picturepopupobj.style.borderWidth = '1px';
 picturepopupobj.style.borderColor = '#000000';

 picturepopupobj.style.left = (myWidth / 2) - (breedte / 2) + 'px';
 picturepopupobj.style.display = 'block';
}

function closePicturePopup()
{
 document.getElementById('picturebackground').style.display = 'none';
 document.getElementById('picturepopup').style.display = 'none';
}
