window.getInnerHeight = function ()
{
    var window_height = 0;
    if ( typeof( window.innerHeight ) == 'number' )
       window_height = window.innerHeight;
    else
    if (
         document.documentElement
      && document.documentElement.clientHeight
       )
       window_height = document.documentElement.clientHeight;
    else
    if (
         document.body
      && document.body.clientHeight
       )
       window_height = document.body.clientHeight;

    return window_height;
}



window.getInnerWidth = function()
{
    var window_width = 0;
    if ( typeof( window.innerWidth ) == 'number' )
       window_width = window.innerWidth;
    else
    if (
         document.documentElement
      && document.documentElement.clientWidth
       )
       window_width = document.documentElement.clientWidth;
    else
    if (
         document.body
      && document.body.clientWidth
       )
       window_width = document.body.clientWidth;

    return window_width;
}



window.pageOffsetY = function()
{
    if ( window.pageYOffset )
    {   return window.pageYOffset; }

    var body = window.document.compatMode
            && window.document.compatMode == "CSS1Compat"
             ? window.document.documentElement
             : window.document.body || null;

    return body.scrollTop;
}



window.pageOffsetX = function()
{
    if ( window.pageXOffset )
    {   return window.pageXOffset; }

    var body = window.document.compatMode
            && window.document.compatMode == "CSS1Compat"
             ? window.document.documentElement
             : window.document.body || null;

    return body.scrollLeft;
}

