// Dit script maakt gebruik van de volgende componenten van YUI:
// YUI Container & YUI Stylesheet 
var bncImgPopup;

function bncShowImg(url){
	try {
		if (bncImgPopup == null) {
			var css = "#bncImgPopup_mask{background-color:#000;opacity:.25;filter:alpha(opacity=25);}" +
			".yui-skin-bnc .container-close{position:absolute;top:-10px;right:-10px;width:25px;height:25px;background:url('/extras/bnc/icons/bnc/sluiten.png') no-repeat;cursor:pointer;}" +
			".yui-skin-bnc .container-close:hover{background-image: url('/extras/bnc/icons/bnc/sluiten-hover.png');}";
			sheet = new YAHOO.util.StyleSheet(css);
			var bncImgPopupContainer = document.createElement("div");
			bncImgPopupContainer.id = "bncImgPopupContainer";
			bncImgPopupContainer.className = "yui-skin-bnc";
			document.body.appendChild(bncImgPopupContainer);
			bncImgPopup = new YAHOO.widget.SimpleDialog("bncImgPopup", {
				visible: false,
				draggable: false,
				constraintoviewport: true,
				fixedcenter: true,
				close: true,
				modal: true
			});
			var bncImgShow = function(){
				bncImgPopup.show();
			};
			var bncImgHide = function(){
				bncImgPopup.hide();
			};
			var bncImgContainer = document.createElement("div");
			var now = new Date();
			var bncImg = new Image();
			bncImg.id = "bncImg";
			bncImg.onload = bncImgShow;
			bncImg.onclick = bncImgHide;
			bncImg.src = url + "?noCache=" + now.getTime();
			bncImgContainer.appendChild(bncImg);
			bncImgPopup.setBody(bncImgContainer);
			bncImgPopup.render(bncImgPopupContainer);
		} else {
			var now = new Date();
			document.getElementById('bncImg').src = url + "?noCache=" + now.getTime();
		}
	} catch(error) {
		alert(error);
	}
}
