var winHandle = null;

function popImage(sURL, sTitle, w, h) {
	var h = WinPopup('/popup.asp?src='+escape(sURL)+'&title='+escape(sTitle)+'&w='+w.toString()+'&h='+h.toString(), 'vvvimgpopup', w,h);
	return false;
}

function popAfbeelding(sName) {
	var h = WinPopup('/afbeelding.asp?src=' + escape(sName), 'vvvafbeelding', 900, 720, 'yes', 'no');
	return false;
}

function WinPopup(sURL, sWinName, iWidth, iHeight, sScroll, sFull) {
	if ((winHandle != null) && (!winHandle.closed)) { winHandle.focus(); return false; }

	if (typeof(iWidth)  =='undefined') iWidth  = 560;
	if (typeof(iHeight) =='undefined') iHeight = 250;
	if (typeof(sWinName)=='undefined') sWinName= 'WinPopup';
	if (typeof(sScroll) =='undefined') sScroll= 'no';
	if (typeof(sFull)   =='undefined') sFull  = 'no';
	
	var sOut = '+&+';
	var sAdd = '%26';
	var sTemp = '' + sURL;
	var sPos = '';
	
	while (sTemp.indexOf(sOut)>-1) {
		sPos = sTemp.indexOf(sOut);
		sTemp = '' + (sTemp.substring(0, sPos) + sAdd + sTemp.substring((sPos + sOut.length), sTemp.length));
	}
	
	var sFeatures = 'scrollbars='+sScroll+',status='+sScroll+',resizable='+sScroll+',width=' + iWidth + ',height=' + iHeight + ',top=' + ((screen.height-iHeight)/2) + ',left=' + ((screen.width-iWidth)/2) + ',fullscreen=' + sFull;
	var sURL = sTemp;

	winHandle = window.open(sURL, sWinName, sFeatures);

	return winHandle;
}
