PositionX = 100;
PositionY = 100;
defaultWidth  = 1024;
defaultHeight = 768;
var AutoClose = false;
if (parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isO=(navigator.appName=="Opera")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}

var optNN='scrollbars=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optO='scrollbars=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
	trcImage = new Image();
	trcImage.src = imageURL;
	imageRealTitle = imageTitle;

	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isO){imgWin=window.open('about:blank','',optO);}
	if (isIE){imgWin=window.open('about:blank','',optIE);
		imageTitle = "Loading: " + imageTitle;}

	with (imgWin.document){
		writeln('<html><head><title>'+imageTitle+'</title><style>body{margin:0px;}</style>');
		writeln('<sc'+'ript>');

			writeln('var isNN,isO,isIE;');

			writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
				writeln('isNN=(navigator.appName=="Netscape")?1:0;');
				writeln('isO=(navigator.appName=="Opera")?1:0;');
				writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');

			writeln('function doTitle(){');
				writeln('if (isIE) {document.title="'+imageRealTitle+'";}}');
				
			writeln('function reSizeToImage(){');
				writeln('if (isIE){');
					writeln('window.resizeTo(100,100);');
					writeln('width=123-(document.body.clientWidth-document.images[0].width);');
					writeln('if (navigator.userAgent.indexOf("MSIE 7.")!=-1) {width += 126};');
					writeln('height=100-(document.body.clientHeight-document.images[0].height);');
					writeln('window.resizeTo(width,height);}');
				writeln('if (isNN){');
					writeln('window.innerWidth=document.images["Lara"].width;');
					writeln('window.innerHeight=document.images["Lara"].height;}}');
				writeln('if (isO){');
					writeln('var imgwidth = '+(trcImage.width+30)+';');
					writeln('var imgheight = '+trcImage.height+';');
					writeln('if(imgheight > screen.height) {imgheight = screen.height-(screen.height/8)}');
					writeln('window.resizeTo(imgwidth,imgheight);}');
			

		writeln('</sc'+'ript>');

		if (!AutoClose) writeln('</head><body bgcolor=ffffff scroll="yes" onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor=ffffff scroll="yes" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');

		writeln('<img name="Lara" id="Lara" src='+imageURL+' style="display:block"></body></html>');
		close();
	}
}