function openImageWindow(filename,width,height,caption) {
	ImageWindow = document.getElementById('ImageWindow');
	if (ImageWindow) { ImageWindow.close(); }
	ImageWindow = window.open("","ImageWindow","width=" + width + ",height=" + height + ",scrollbars=no,screenY=50,screenX=50,top=50,left=50");
	imagecode = "<ht"+"ml>\
		<title>"+caption+"<\/title>\
		<bo"+"dy bgcolor=ffffff marginheight=0 marginwidth=0 topmargin=0 leftmargin=0>\
		<center>\
		<table width=100% height=100% cellpadding=0 cellspacing=0 border=0>\
		<td valign=middle align=center>\
		<a href=\"Javascr"+"ipt: window.close()\">\
		<img border=0 src=\"/" + filename + "\" width=" + width + " height=" + height + "\
			onLoad=\"\
				if(this.height > document.body.clientHeight)\
				{\
					this.width = parseInt(this.width * (document.body.clientHeight) / (this.height - 20));\
					this.height = document.body.clientHeight - 20;\
				}\
			\"\
		>\
		</a>\
		<br>\
		</td>\
		</table>\
		</center>\
		</bo"+"dy>\
		</ht"+"ml>";
	ImageWindow.document.write(imagecode);
	ImageWindow.document.close();
	ImageWindow.focus();
}