function getPageDimension() {
    if (window.innerWidth != null) {
        return {width: window.innerWidth, height: window.innerHeight } ;
    }

    if (document.body != null) {
        return {width: document.body.clientWidth, height: document.body.offsetHeight} ;
    }

    return null;
}

function getScrollXY() {
    if (window.pageXOffset != null) {
        return {x: window.pageXOffset, y: window.pageYOffset} ;
    }

    if (document.body != null) {
        return {x: document.body.scrollLeft, y: document.body.scrollTop} ;
    }

    return {x: 0, y:0} ;
}


