PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically when clicked off
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
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=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=yes,width=150,height=100,left='+PositionX+',top='+PositionY;
var jsString = '';
function popImage(imageURL,imageTitle){
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	
	with (imgWin.document){
		writeln('<html><head><title>Loading...</title><style>body{margin:0;}</style>');
		if (!AutoClose) {
			writeln('</head><body onload="reSizeToImage();doTitle();self.focus();">');
		} else {
			writeln('</head><body onload="reSizeToImage();doTitle();self.focus();" onblur="self.close()">');
		}
		
		writeln('<img name="targetImg" src='+imageURL+' style="display:block"></body>');
	
		jsString = '<script>'
		+ 'var isNN,isIE;'
		+ 'if (parseInt(navigator.appVersion.charAt(0))>=4) {'
		+ '	isNN=(navigator.appName=="Netscape")?1:0;'
		+ '	isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;'
		+ '}'
		+ 'function reSizeToImage(){'
		+ '	if (isIE){'
		+ '		window.resizeTo(100,100);'
//		+ '		width=100-(document.body.clientWidth-document.images[0].width);'
		+ '		width=document.images[0].width+27;'	//27 for vertical scrollbar
		+ '		height=100-(document.body.clientHeight-document.images[0].height);'
		+ '		window.resizeTo(width,height);'
		+ '	}'
		+ '	if (isNN){'
		+ '		window.innerWidth=document.images["targetImg"].width;'
		+ '		window.innerHeight=document.images["targetImg"].height;'
		+ '	}'
		+ '}'
		+ 'function doTitle(){'
		+ '	document.title="'+imageTitle+'";'
		+ '}'
		+ '</script>';
		
		writeln(jsString);
		writeln('</html>');
		close();	
	}
	
}