var link, jongenObject, fotoladen, fotobreedte, windowWidth, windowHeight 
var verhouding = 1

window.onload = function() {
var j=0
for (var i=0;i < document.links.length;i++){
  link=document.links[i]
  var xlink = new Object(link); // dit is nodig voor opera
  if (xlink.getAttribute('rel') == 'vergroot') {
     if (document.addEventListener) {  // DOM Level 2 event model
	xlink.addEventListener("click", jongenObject[j].method1, false);
   j++
   	}	
  else if(document.attachEvent) {  // IE 5+ Event Model
	xlink.attachEvent("onclick", jongenObject[j].method1 );
   j++
  }
	xlink.removeAttribute('href', false)
  	i--
 }
}

if (self.innerHeight) {	// all except Explorer
  windowWidth = top.innerWidth;
  windowHeight = top.innerHeight;
  } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
  windowWidth = document.documentElement.clientWidth;
  windowHeight = document.documentElement.clientHeight;
  } else if (document.body) { // other Explorers
  windowWidth = document.body.clientWidth;
  windowHeight = document.body.clientHeight;
}
document.getElementById('veldfoto').style.left = ( windowWidth - 100 ) / 2 + "px"
}



function toonfoto(keuze) {
fotoladen = new Array()
fotoladen[0] = new Image()
fotoladen[0].src = keuze

if( windowHeight - 150 < 550)
  verhouding = 550 / ( windowHeight - 150)

document.images.imgtransparant.style.visibility = "visible"
document.images.imgfoto.style.visibility = "visible"
document.images.imgfoto.style.height = "48px"
document.images.imgfoto.style.width = "48px"
document.images.imgfoto.src = "loading.gif"
document.getElementById('veldfoto').style.visibility = "visible"
controle = window.setInterval("controleerladen()",50)
}

function controleerladen(){
if(fotoladen[0].complete){
document.images.imgfoto.style.visibility = "hidden" 
document.images.imgfoto.src = fotoladen[0].src
fotobreedte = fotoladen[0].width
document.getElementById('veldfoto').style.left = ( windowWidth - (fotobreedte / verhouding ) - 100 ) / 2 + "px"
document.getElementById('veldfoto').style.width = ( fotobreedte + 100 ) / verhouding + "px"
document.getElementById('veldfoto').style.height= 610 / verhouding + "px"
document.images.imgfoto.style.width =  fotobreedte / verhouding + "px"
document.images.imgfoto.style.height =  550 / verhouding + "px"
document.images.imgfoto.style.visibility = "visible"
window.clearInterval(controle)
}
}

function sluitfoto(){
document.images.imgfoto.style.visibility = "hidden" 
document.getElementById('veldfoto').style.visibility = "hidden"
document.images.imgtransparant.style.visibility = "hidden"
}
