
function OpenWin(p_title,p_src,img_width,img_height){

	app = navigator.appName.charAt(0);
	ver = navigator.appVersion.charAt(0);

  	source = p_src;
	winwidth = img_width + 40;
	winheight = img_height + 110;
	if ((screen.width < winwidth) || (screen.height < winheight)) {
		xscroll = "scrollbars=yes,resizable=yes";
		winwidth = (screen.width < winwidth) ? screen.width : winwidth;
		winheight = (screen.height < winheight) ? screen.height : winheight;
	} else {
		xscroll = "scrollbars=no,resizable=yes";
	}
	
	if (app == "N") {
		NewWin = window.open("","ImgPreview","toolbar=no,location=no,status=yes,menubar=no," + xscroll + ",width=" + winwidth + ",height=" + winheight + ",alwaysRaised=no,screenX=0,screenY=0");
	} else if (app == "M") {
		NewWin = window.open("","ImgPreview","toolbar=no,location=no,status=yes,menubar=no," + xscroll + ",width=" + winwidth + ",height=" + winheight + ",alwaysRaised=no,top=0,left=0");
	} else {
		NewWin = window.open("","ImgPreview","toolbar=no,location=no,status=yes,menubar=no," + xscroll + ",width=" + winwidth + ",height=" + winheight + ",alwaysRaised=no,top=0,left=0");
	}
	NewWin.resizeTo(winwidth,winheight);
	NewWin.document.open();
	NewWin.document.write("<html><head><title>" + p_title + "</title></head>");
	NewWin.document.write("<body bgcolor=black><center>");
	NewWin.document.write("<img src=" + source + " width=" + img_width + " height=" + img_height + "><br>");
	NewWin.document.write("<table border=0 cellspacing=0 cellpadding=5 width=" + img_width + ">");
	NewWin.document.write("<tr valign=top><td>");
	NewWin.document.write("<font size=2 color='#FFFFFF' style='{font:12px;}'>" + p_title + "</font>");
	NewWin.document.write("</td><td align=right>");
	NewWin.document.write("<form><input type=button value=close onclick=javascript:window.close()></form>");
	NewWin.document.write("</td></tr></table>");
	NewWin.document.write("</center></body></html>");
	NewWin.focus();
	NewWin.document.close();
}

