// JavaScript Document

function popupgalimage(imgsrc, popwidth, popheight){
	leftpos = (screen.width) ? (screen.width-popwidth)/2 : 0;
	toppos = (screen.height) ? (screen.height-popheight)/2 : 0;
	var windowdesc='width='+popwidth+',height='+popheight+',resizable=no';

	popwincontent = "<html><head><title>"+imgsrc+"</title>";
	popwincontent += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />";
	popwincontent += "<meta http-equiv=\"imagetoolbar\" content=\"no\" /><style><!-- body {";
	popwincontent += " background-color: #000; padding: 0px; margin: 0px; overflow: hidden; }";
	popwincontent += " img {border: 1px none #000;}--></style>";
	popwincontent += " <body><a href=\"#\" onclick=\"javascript:window.close()\"><img src="+imgsrc+" alt=\"click to close\" />";
	popwincontent += "</a></body></html>";

	if (typeof popupgalwin=="undefined" || popupgalwin.closed) {
		popupgalwin=window.open("","popupgalwin",windowdesc)
		popupgalwin.document.write(popwincontent);
		popupgalwin.moveTo(leftpos, toppos);
	}
	else {
		popupgalwin.close()
		popupgalwin=window.open("","popupgalwin",windowdesc)
		popupgalwin.document.write(popwincontent);
		popupgalwin.moveTo(leftpos, toppos);
	}
}
