/* isNet for mozilla */
var isNet = (navigator.appName.indexOf("Netscape") != -1);
var isIE  = (navigator.appName.indexOf("Microsoft") != -1);
var isOp  = (navigator.appName.indexOf("Opera") != -1);

//-------------------------------------------------------------------
// hh and ww are optional but it is recommended to use them
function ViewImage(img,title)
{
   var w = 0;
   var h = 0;
   var l  = screen.width/2-200;
   var t = screen.height/2-200;

   if ( isIE )
   {
  	  w = 17;
  	  h = 77;
  	}
  	else if ( isNet )
  	{
  	  w = 28;
  	  h = 55;
  	}
  	else if ( isOp )
  	{
  	  w = 25;
  	  h = 60;
  	}
	else {
  	  w = 28;
  	  h = 55;
	}

	viewpic=open("",'image','width=400,height=400,menubar=no,screenx=,toolbar=no,scrollbars=no,resizable=no,top='+t+',left='+l);	
	viewpic.document.write("<HTML><HEAD><TITLE>"+title+"</TITLE><link href='styles/main.css' rel=stylesheet type='text/css'><link href='styles/sun.ico' rel='SHORTCUT ICON'></HEAD>");
	viewpic.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+"+w+",document.images[0].height+"+h+"); window.moveTo((screen.width - document.images[0].width)/2,(screen.height - document.images[0].height)/2); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	viewpic.document.write("<BODY class=bg-body onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' class='itemPic' oncontextmenu='return false' border=0/>");
	viewpic.document.write("");
	viewpic.document.write("</BODY></HTML>");
	viewpic.document.close();
}

