// ----------------------------------------------------------------------
// popImage() - Pop up an image in an auto resized window
// ----------------------------------------------------------------------
var PositionX = 0; var PositionY = 0;
var defaultWidth = 100; var defaultHeight = 100;
var AutoClose = true;
if(parseInt(navigator.appVersion.charAt(0))>=4)
{
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=100,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle)
{
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	with (imgWin.document)
	{
		writeln('<html><head><title>Loading...</title>');
		writeln('<style type="text/css">body{margin:0px;}</style>');
		writeln('<script type="text/javascript">');
		writeln('var isNN,isIE;');
		writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');
		writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');
		writeln('if (isIE){');
		writeln('window.resizeTo(100,100);');
		writeln('var width=document.images[0].width;');
		writeln('var height=document.images[0].height;');
		writeln('var left=screen.width*.5-document.images[0].width*.5;');
		writeln('var top=screen.height*.5-document.images[0].height*.5;');
		writeln('window.moveTo(left,top);');
		writeln('window.resizeTo(width,height);}');
		writeln('if (isNN){');
		writeln('var width=document.images["George"].width;');
		writeln('var height=document.images["George"].height;');
		writeln('var left=screen.width*.5-document.images["George"].width*.5;');
		writeln('var top=screen.height*.5-document.images["George"].height*.5;');
		writeln('window.moveTo(left,top);');
		writeln('window.resizeTo(width,height);}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');
		writeln('</script>');
		if (!AutoClose) writeln('</head><body bgcolor=#000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor=#000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
		writeln('<img name="George" src='+imageURL+' style="display:block" alt=""></body></html>');
		close();
	}
}
