function ViewImage(ifile,ix,iy,ititle) { 
var win;
var winL;
var winT;
winL = screen.width / 2 - ix / 2;
winT = screen.height / 2 - iy / 2;
win = window.open("","imageviewer","top="+winT+",left="+winL+",width="+ix+",height="+iy+",menubar=no,toolbar=no");
win.document.open();
win.document.write("<html><head><title>"+ititle+"</title></head><body onload='window.focus()' onblur='self.close()'>");
win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
win.document.write("<img src="+ifile+" title='Закрыть окно' onclick='window.close()' style='cursor:pointer;cursor:hand'></div></body></html>");
win.document.close();
}