- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/classes/general/file.php
- Класс: CFile
- Вызов: CFile::ImgShw
function ImgShw(ID, width, height, alt)
{
var scroll = "no";
var top=0, left=0;
var w, h;
if(navigator.userAgent.toLowerCase().indexOf("opera") != -1)
{
w = document.body.offsetWidth;
h = document.body.offsetHeight;
}
else
{
w = screen.width;
h = screen.height;
}
if(width > w-10 || height > h-28)
scroll = "yes";
if(height < h-28)
top = Math.floor((h - height)/2-14);
if(width < w-10)
left = Math.floor((w - width)/2-5);
width = Math.min(width, w-10);
height = Math.min(height, h-28);
var wnd = window.open("","","scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
wnd.document.write(
""+
"<"+"script type="text/javascript">"+
"function KeyPress(e)"+
"{"+
" if (!e) e = window.event;"+
" if(e.keyCode == 27) "+
" window.close();"+
"}"+
""+"script>"+
""+(alt == ""? "'.GetMessage("main_js_img_title").'":alt)+""+
""+
"
"+
""
);
wnd.document.close();
wnd.focus();
}