var d = document;

function zoomPhoto(url){
	if(url=='close'){
		d.getElementById('zoomPhoto').style.visibility='hidden';	
		d.getElementById('zoomPhotoImage').parentNode.removeChild(d.getElementById('zoomPhotoImage'));
		d.getElementById('zoomPhotoLocation').parentNode.removeChild(d.getElementById('zoomPhotoLocation'));
	}else{
		var imgThumbUrl = url.src;
		if(d.getElementById('zoomPhotoImage')){
			d.getElementById('zoomPhotoImage').parentNode.removeChild(d.getElementById('zoomPhotoImage'));
			d.getElementById('zoomPhotoLocation').parentNode.removeChild(d.getElementById('zoomPhotoLocation'));
		}
		if (null!==imgThumbUrl.match("thumbs/")){
			imgUrl = imgThumbUrl.replace('thumbs/','');
			newImg = d.createElement('img');
			newImg.setAttribute('src',imgUrl);
			newImg.setAttribute('id','zoomPhotoImage');
			newImg.setAttribute('alt','Klik hier om de afbeelding te sluiten');
			newImg.onclick 	= new Function("zoomPhoto('close');");			
			newDiv = d.createElement('div');
			newDiv.onclick 	= new Function("zoomPhoto('close');");
			newDiv.setAttribute('id','zoomPhotoLocation');
			d.getElementById('zoomPhoto').parentNode.insertBefore(newDiv, d.getElementById('zoomPhoto'));
			d.getElementById('zoomPhotoLocation').appendChild(newImg);
			d.getElementById('zoomPhoto').onclick = new Function("zoomPhoto('close');");
			d.getElementById('zoomPhoto').style.visibility='visible';			
		}
	}
}
