﻿function isIE() {
    if (navigator.appName == "Microsoft Internet Explorer")
        return true;
    else
        return false;
};

function getWindowWidth() {
    var winWidth = 0;
    if (isIE()) {
        //winWidth = window.document.body.clientWidth;
        //if (winWidth == 0)
        winWidth = window.document.documentElement.clientWidth;
    } else winWidth = document.body.clientWidth;  //window.innerWidth;
    winWidth = parseInt(winWidth);
    //alert(winWidth);
    if (winWidth < 0) winWidth = 0;
    return winWidth;
};

function getWindowHeight() {
    var winHeight = 0;
    if (isIE()) {
        //winHeight = window.document.body.clientHeight;
        //if (winHeight == 0)
            winHeight = window.document.documentElement.clientHeight;
        } else winHeight = document.body.clientHeight; // window.innerHeight;
    winHeight = parseInt(winHeight);
    //alert(winHeight);
    if (winHeight < 0) winHeight = 0;
    return winHeight;
};

function getScrollXY() {
    var x = 0, y = 0;
    if (typeof (window.pageYOffset) == 'number') {
        // Netscape
        x = window.pageXOffset;
        y = window.pageYOffset;
    } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
        // DOM
        x = document.body.scrollLeft;
        y = document.body.scrollTop;
    } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
        // IE6 standards compliant mode
        x = document.documentElement.scrollLeft;
        y = document.documentElement.scrollTop;
    }
    return [x, y];
}

function isInt(strNum) {
    var ok = true;
    var re = /\d/;

    ok = re.test(strNum);

    return ok;
};

function str2Int(str) {
    if (isInt(str))
        return parseInt(str);
    else
        return 0;
};

function masterReSize() {
    var xy = getScrollXY();

    
}



