﻿function openImageWindow(img, width, height)
{       
    var NewWindow
    var left = (screen.width-width)/2;
    var top = (screen.height-height)/2;

    var sFeatures = "top="+top+", left="+left+", width="+width+", height="+height+", "
            + "toolbar=no, menubar=no, location=no, directories=no, resizable=no, scrollbars=no";
    NewWindow = open("", "myWin", sFeatures, true);
    NewWindow.document.open();
    NewWindow.document.writeln("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>"+
    "<html xmlns='http://www.w3.org/1999/xhtml'>"+
    "<head>"+
        "<title>Фото</title>"+
    "</head>"+
    "<body style='margin: 0px; padding: 0px'>"+
    "<img src='"+img+"' width='"+width+" 'height='"+height+"' alt='' />"+
    "</body>"+
    "</html>");
    NewWindow.document.close();              
}
function openWindow(sPage, width, height)
{
    var left = (screen.width-width)/2;
    var top = (screen.height-height)/2;

    var sFeatures= "top="+top+", left="+left+", width="+width+", height="+height+", "
	    + "toolbar=no, menubar=no, location=no, directories=no, resizable=no, scrollbars=yes";
    var oNewWindow = window.open(sPage, "", sFeatures, true);
}
function ITGetElementById(id)
{
    if (document.getElementById(id))
        return document.getElementById(id);
    else
        if (document.all[id])
            return document.all[id];
        else
            if (document.layers && document.layers[id])
                return (document.layers[id]);
            else
                return false;
}
function GetScrollY()
{
    if (window.navigator.appName.toLowerCase().indexOf('explorer') == -1)
    {
        return window.pageYOffset;
    }
    else
    {
        if (document.documentElement && document.documentElement.scrollTop) {
            return document.documentElement.scrollTop;
        }
        else if (document.body) {
            return document.body.scrollTop;
        }
    }
    return 0;
}
function isNumber(evt)
{
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))  return false;
    return true;
}