function ViewImage(ifile,ix,iy) { 
	var win;
	var sWidth;
	var sHeight;
	var agt=navigator.userAgent.toLowerCase();

	win = window.open("","imageviewer","width="+ix+",height="+iy+",location=no,directories=no,resizable=no,scrollbars=no,menubar=no,status=no");

	// Resize window to exactly fit image, in case we're re-using an old window.  This has to be done differently for
	// IE than for other browsers.

	if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
		win.resizeTo( ix, iy );
	} else {
		// First we have to figure out how much space the title bar, etc. take up and add that to the browser size.
		sWidth = win.outerWidth - win.innerWidth;
		sHeight = win.outerHeight - win.innerHeight;
		win.resizeTo( ix+sWidth, iy+sHeight );
	}

	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

	win.document.open();
	win.document.write("<html><head><title>Click on the picture to close the window.</title>");
	win.document.write("</head><body>");
	win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
	win.document.write("<a href='javascript:window.close();'><img border=0 src="+ifile+"></div></body></html>");
	win.document.close();
}
