PositionX = 50;
PositionY = 50;
defaultWidth  = 780;
defaultHeight = 600;
var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
    var isNN=(navigator.appName=="Netscape")?1:0;
    var isOP=(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 optOP='scrollbars=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=yes,width=450,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle)
    {
	if (isNN)
	    {
		imgWin=window.open('about:blank','',optNN);
	    }
	

	if (isOP)
	    {
		imgWin=window.open('about:blank','',optOP);
	    }
	    
	if (isIE)
	    {
		imgWin=window.open('about:blank','',optIE);
	    }
	    
	with (imgWin.document)
	    {
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
		
		writeln('<sc'+'ript>');
		
		writeln('var isNN,isOP,isIE;');
		
		writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');
		writeln('isOP=(navigator.appName=="Opera")?1:0;');
		writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		
		writeln('function reSizeToImage(){');
		
		writeln('if (isIE){');
		writeln('window.resizeTo(100,100);');
		writeln('width=100-(document.body.clientWidth-document.images[0].width);');
		writeln('height=100-(document.body.clientHeight-document.images[0].height);');
		writeln('window.resizeTo(width+150,height);}');

		writeln('if (isOP){');       
		writeln('window.resizeTo(100,100);');
		writeln('width=100-(document.body.clientWidth-document.images[0].width);');
		writeln('height=100-(document.body.clientHeight-document.images[0].height);');
		writeln('window.resizeTo(width+12,height);}');
		
		writeln('if (isNN){');       
		writeln('window.innerWidth=document.images["Zoom"].width;');
		writeln('window.innerHeight=document.images["Zoom"].height;}}');
		
		writeln('function doTitle(){document.title="'+imageTitle+'";}');
	
		writeln('</sc'+'ript>');
		
		if (!AutoClose) writeln('</head><body bgcolor="#ffffff" scroll="yes" onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor=000000 scroll="yes" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
		writeln('<img name="Zoom" src='+imageURL+' style="display:block"></body></html>');
		close();		
	    }
    }


function popImage2(name, winname)
{
   msgWindow = window.open("about:blank", "", "status=yes,scrollbars=yes,resizable=yes,left=10,top=0,height="+(screen.height)+",width="+(screen.width-100));
    
   msgWindow.document.write("<html><head><title>"+winname+"</title></head><body bgcolor=#FFFFFF leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>");

   msgWindow.document.write("<table border=0 width=100% height=100%><tr><td align='center'>");
   msgWindow.document.write("<img src='"+name+"'>");
   msgWindow.document.write("</td></tr></table></body></html>");
}

