
wname = 1;

function cmfshowpic(image,title)
{

w = 400;
h = 300;
params = "'toolbar=no,location=no,directories=no,menubar=no,resizable=1,width=" + w +",height=" + h;
if(document.all) params += ",left=175,top=200'";
else params += ",screenX=175,screenY=200'";

d = new Date();
winname = d.getTime();
winname = window.open("",wname,params);
winname.document.open();
winname.document.writeln ("<html><head><title>" + title + "</title></head><body link=black vlink=black onLoad=FitPic();>");
winname.document.writeln ("<table cellpadding=0 cellspacing=0 border=0 align=center><tr><td align=center valign=middle colspan=2>");
winname.document.writeln ("<img src='" + image + "' border=0>");
winname.document.writeln ("</td></tr><tr><td valign=top>");
if(pic.arguments[2]){
  winname.document.writeln ("<span style=color:#a2a2a2;font-family:Verdana;font-size:7pt;>" + pic.arguments[2] + "</span><br>");
}
winname.document.writeln ("</td><td align=right valign=top><strong><a href='javascript:window.close();'><font face=verdana size=-2>close window</font></a></strong></center></td></tr></table>");
winname.document.writeln ("<script language=JavaScript>");
winname.document.writeln ("if(document.images.length!=0) setTimeout('window.opener.resizeWindow()',1000);");
winname.document.writeln ("var arrTemp=self.location.href.split(\"?\");");
winname.document.writeln ("var picUrl = (arrTemp.length>0)?arrTemp[1]:\"\";");
winname.document.writeln ("var NS = (navigator.appName==\"Netscape\")?true:false;");
winname.document.writeln ("  function FitPic() {");
winname.document.writeln ("    iWidth = (NS)?window.innerWidth:document.body.clientWidth;");
winname.document.writeln ("    iHeight = (NS)?window.innerHeight:document.body.clientHeight;");
winname.document.writeln ("    iWidth = document.images[0].width - iWidth;");
winname.document.writeln ("    iHeight = document.images[0].height - iHeight;");
winname.document.writeln ("    window.resizeBy(iWidth+50, iHeight+50);");
winname.document.writeln ("    self.focus();  }");
winname.document.writeln ("</script>");
winname.document.writeln ("</body></html>");
winname.document.close();

winname.focus();

setTimeout('resizeWindow()',500);
}    

function resizeWindow() 
{
	if (document.images) 
	{
		if (winname.document.images.length!=0) 
		{
		if (document.layers) winname.resizeTo(winname.document.images[0].width+20,winname.document.images[0].height+75)
		else if (document.all) winname.resizeTo(winname.document.images[0].width+30,winname.document.images[0].height+75)
		else if (document.getElementById) winname.resizeTo(winname.document.images[0].width+40,winname.document.images[0].height+85)	
		}
	else 
		setTimeout('resizeWindow()',1000);
	}
}

