function popupImageWnd(ImagePath,WindowTitle)
{
	var WindowFeatures="";
	var AutoCloseWnd=true;
	var pScreenX=70;
	var pScreenY=70;
	var dWidth=800;
	var dHeight=600;
	
	var BrowserNN=(navigator.appName=="Netscape")?true:false;
	var BrowserIE=(navigator.appName.indexOf("Microsoft")!=-1)?true:false;

	if(BrowserNN) {
		WindowFeatures	=	"scrollbars=yes";
		WindowFeatures	+=	",screenX="+pScreenX;
		WindowFeatures	+=	",screenY="+pScreenY;
		WindowFeatures	+=	",width="+dWidth;
		WindowFeatures	+=	",height="+dHeight;
		WindowFeatures	+=	",status=0";
		WindowFeatures	+=	",menubar=0";
		WindowFeatures	+=	",resizable=1";
		WindowFeatures	+=	",toolbar=0";
}
	else if(BrowserIE) {
		WindowFeatures	=	"scrollbars=auto";
		WindowFeatures	+=	",left="+pScreenX;
		WindowFeatures	+=	",top="+pScreenY;
		WindowFeatures	+=	",width=100";
		WindowFeatures	+=	",height=200";
		WindowFeatures	+=	",status=0";
		WindowFeatures	+=	",menubar=0";
		WindowFeatures	+=	",resizable=1";
		WindowFeatures	+=	",toolbar=0";
	}
	
	
	var myWin=window.open('about:blank','',WindowFeatures);
	with(myWin.document)
	{
		writeln('<html>');
		writeln('<head>');
		writeln('<title>'+WindowTitle+'</title>');
		////////////////////////////////////////////////////////////////////////////
		writeln('<style>');
		writeln('body{margin:0px;}');
		writeln('</style>');
		////////////////////////////////////////////////////////////////////////////
		writeln('<sc'+'ript>');

		writeln('var BrowserNN=(navigator.appName=="Netscape")?true:false;');
		writeln('var BrowserIE=(navigator.appName.indexOf("Microsoft")!=-1)?true:false;');

		writeln('function setClientSize(W, H)');
		writeln('{');
		writeln('window.resizeTo(W, H);');
		writeln('var cp = document.createElement("div");');
		writeln('cp.style.position = "absolute";');
		writeln('cp.style.width = "0px";');
		writeln('cp.style.height = "0px";');
		writeln('cp.style.right = "0px";');
		writeln('cp.style.bottom = "0px";');
		writeln('document.body.appendChild(cp);');
		writeln('var current_width = cp.offsetLeft;');
		writeln('var current_height = cp.offsetTop;');
		writeln('var dw = W - current_width;');
		writeln('var dh = H - current_height;');
		writeln('window.resizeBy(dw, dh);');
		writeln('document.body.removeChild(cp);');
		writeln('}');


		writeln('function ResizeWindow()');
		writeln('{');
		writeln('imgWidth=document.images["wndimage"].width;');
		writeln('imgHeight=document.images["wndimage"].height;');
		//////////////////////////////////////////////
		writeln('if (BrowserNN)');
		writeln('{');
			writeln('if(imgHeight>700)');
			writeln('{');
			writeln('window.innerWidth=imgWidth;');
			writeln('window.innerHeight=500;');
			writeln('document.body.scroll="yes";');
			writeln('}');
			writeln('else');
			writeln('{');
			writeln('window.innerWidth=imgWidth;');
			writeln('window.innerHeight=imgHeight;');
			writeln('}');
			//writeln('window.resizeTo(imgWidth+10,imgHeight+82);');
		writeln('}');
		//////////////////////////////////////////////
		writeln('if (BrowserIE)');
		writeln('{');
			writeln('if(imgHeight>700)');
			writeln('{');
			writeln('window.resizeTo(imgWidth,500);');
			writeln('document.body.scroll="yes";');
			writeln('}');
			writeln('else');
			writeln('{');
			writeln('setClientSize(imgWidth,imgHeight);');
			writeln('}');
			//writeln('window.resizeTo(imgWidth+10,imgHeight+82);');
		writeln('}');
		//////////////////////////////////////////////
		writeln('window.status="'+WindowTitle+'";');
		writeln('}');
		writeln('</sc'+'ript>');
		////////////////////////////////////////////////////////////////////////////
		writeln('</head>');
		
		if(AutoCloseWnd==true)
		{
			writeln('<body onload="javascript:ResizeWindow();self.focus();" onblur="self.close()">');
		}
		else
		{
			writeln('<body onload="javascript:ResizeWindow();self.focus();">');
		}


		writeln('<div align="center"><img border="0" name="wndimage" src='+ImagePath+' /></div>');
		writeln('</body>');
		writeln('</html>');
		close();
	}
}

