var opened;
var adres;

function showImg(ref, titel, width, height)
{
	showImgT(ref, titel, "", width, height, 0);
}

function showImgT(ref, titel, text, width, height, textHeight)
{
	status='';
	if(navigator.appName.indexOf('Netscape') < 0)
	{
		if (opened) adres.close();
		else opened = true;
	}

	hoogte	= height + 50;
	toWrite =	"<head><title>"+titel+"<\/title><\/head>" +
				"<body topmargin='0' leftmargin='0' ><img src='"+ref+"' width='"+width+"' height='"+height+"'>";
	if (text!="")
	{
		toWrite +="<table width='100%' border='0' cellpadding='3'><tr><td><FONT FACE='Arial' SIZE='-2'><DIV align='justify'>" + text + "</DIV></FONT></td></tr></table>";
		hoogte += textHeight;
	}
	toWrite +="<DIV align='center'><FORM><INPUT TYPE='BUTTON' VALUE='Sluit dit venster' onClick='window.close()'><\/FORM><\/DIV></body>";


	adres = window.open("", "Plaatje", "height=" + hoogte + ",location=0,directories=0,menubar=0,personalbar=0,scrollbars=0,status=0,toolbar=0,width=" + width + ",resizable=0,left=" + (screen.width-width-15));
	adres.document.open;

	adres.document.write(toWrite);
	adres.document.close;
	adres.focus();
}
