
var nwin;
function openw(obj, title, type) {
	w = 200;
	h = 200;
	if (nwin) {
		nwin.close();
	}
	nwin=window.open((type=="url"?obj:''), 'nwin','width='+w+',height='+h+',left=100,top=100,resizable=0,scrollbars=no,menubar=no');
	if (!title) title = "&nbsp;";
	if (nwin) {
		var d = nwin.document;
		if (type == "url") {
			d.title = title;
		} else if (type == "flash") {
			d.writeln('<html>');
			d.writeln('<head>');
			d.writeln('  <title>'+title+'</title>');
			d.writeln('</head>');
			d.writeln('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
			d.writeln('  <object width="'+w+'" height="'+h+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">');
			d.writeln('    <param name=movie value="'+obj+'"><param name=quality value=high><param name=menu value=0>');
			d.writeln('    <embed src="'+obj+'" quality=high width="'+w+'" height="'+h+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
			d.writeln('  </object>');
			d.writeln('</body>');
			d.writeln('</html>');
			d.close();
		} else {
			d.writeln('<html>');
			d.writeln('<head>');
			d.writeln('  <title>'+title+'</title>');
			d.writeln('</head>');
			d.writeln('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onblur="window.close();">');
			d.writeln('<a onclick="window.close();"><img name="LargeImg" src="'+obj+'" border="0"></a>');
			//d.writeln("<script language='javascript'>alert(document.images['LargeImg'].width)</script>");
			d.writeln("</body onload='"+resizeOuterTo(nwin.document.images['LargeImg'].width, nwin.document.images['LargeImg'].height, nwin) + "'>");
			d.writeln('</html>');
			d.close();
		}
		nwin.focus();
		//resizeOuterTo(nwin.document.images['LargeImg'].width, nwin.document.images['LargeImg'].height, nwin);
	}
}
function resizeOuterTo(w,h, win) {
	
 if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
    win.outerWidth=w+8;
    win.outerHeight=h+29;
   }
   else 
   {
    win.resizeTo(400,300);
    wd = 400-win.document.body.clientWidth;
    hd = 300-win.document.body.clientHeight;
    win.resizeTo(w+wd,h+hd);
   }
 }
}
