// Matt Heleniak <matt.h@adfinem.co.uk>
function show(url,windowTitle,closeOnClick,width,height,t){
	if(!url)return
	function readSize(){if(t.complete)showPopup(t.width,t.height);else setTimeout(readSize,1e2)}
	function showPopup(w,h){with(window.open('','_blank','width='+(width||w)+',height='+(height||h))){document.open(); document.write('<html><head><title>'+(windowTitle||'')+'</title></head><body style="margin:0;padding:0"><img src="'+url+'" style="display: block;'+(closeOnClick?' cursor: pointer;" onclick="self.close()" title="Close window"':'"')+'></body></html>'); document.close();}}
	if(!width||!height)t=new Image(),t.src=url,readSize()
	else showPopup(width,height)
}
