<!-- Begin
var preView=window;
var numOpened=0;
function display_image(ifile,ix,iy,ititle)
{
  	var winwidth;
	var winheight;
	var output;
	winheight = Math.min(iy + 120, screen.height-20);
	winwidth = Math.min(ix + 100, screen.width);
	//if (numOpened>0 & !preView.closed) {preView.window.close()}; //use if you want to auto close window each time another is opened 
	preView = window.open("", "Preview", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,top=0,left=0,copyhistory=0,width="+winwidth+",height="+winheight+"");
	preView.name = (new Date()).getSeconds().toString();	
	preView.document.open();
	output = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN'>"
	output += "<HTML><HEAD>";
	output += "<TITLE>"+ititle+"</TITLE>";
	output += "<LINK REL='stylesheet' HREF='kardel.css' TYPE='text/css'>";
	output += "</HEAD><BODY style='background:#000' TEXT=FFFFFF>";
	output += "<CENTER><B>" + ititle + "</B>";
	output += "<DIV ALIGN=CENTER>";
	output += "<IMG style='padding: 20px; margin: 25px; text-align: center; border:1px solid #eee; background: #888;' ALT='' SRC='" + ifile + "' NAME='image' onload='window.resizeTo(Math.min(document.image.width+140,screen.width-10),Math.min(document.image.height+180,screen.height-20))'>";
	output += "</DIV>";
	output += "<a style='color:#eee' href='' onClick='window.close()'>[ C l o s e ]</a>";
	output += "";
	output += "</BODY></HTML>";
	preView.document.write(output);
	preView.focus();
	preView.document.close();
	numOpened+=1;
}
// End -->
