<!-- GET WINDOW DIMENSIONS (FOR ALL BROWSERS)
    //Returns the height and width for the window and how much has been scrolled.

function getPageHeight() {

    var pageHeight = 0;

    //For all browsers except IE
    if (document.height) {
        pageHeight = document.height;
    }
    //For IE 6 Strict Mode
    //else if (document.documentElement && document.documentElement.scrollHeight) {
    //    pageHeight = document.documentElement.scrollHeight;
    //}
    //For other IE versions
    else if (document.body) {
        pageHeight = document.body.scrollHeight;
    }
    return pageHeight;
}

//Because of the tiny table having width=100% (to minimize height), a fixed value is used instead of this function's result
function getPageWidth() {

    var pageWidth = 0;

    //For all browsers except IE
    if (document.width) {
        pageWidth = document.width;
    }
    //For IE 6 Strict Mode
    //else if (document.documentElement && document.documentElement.scrollWidth) {
    //    pageWidth = document.documentElement.scrollWidth;
    //}
    //For other IE versions
    else if (document.body) {
        pageWidth = document.body.scrollWidth;
    }
    return pageWidth;
}

function getScrolledHeight() {

    var scrolledHeight = 0;

    //For all browsers except IE
    if (window.pageYOffset) {
        scrolledHeight = window.pageYOffset;
    }
    //For IE 6 Strict Mode
    else if (document.documentElement && document.documentElement.scrollTop) {
        scrolledHeight = document.documentElement.scrollTop;
    }
    //For other IE versions
    else if (document.body) {
        scrolledHeight = document.body.scrollTop;
    }
    return scrolledHeight;
}

function getScrolledWidth() {

    var scrolledWidth = 0;

    //For all browsers except IE
    if (window.pageYOffset) {
        scrolledWidth = window.pageXOffset;
    }
    //For IE 6 Strict Mode
    else if (document.documentElement && document.documentElement.scrollLeft) {
        scrolledWidth = document.documentElement.scrollLeft;
    }
    //For other IE versions
    else if (document.body) {
        scrolledWidth = document.body.scrollLeft;
    }
    return scrolledWidth;
}

function getWindowHeight() {

    var windowHeight = 0;

    //For all browsers except IE
    if (window.innerHeight) {
        //Compensate for the horizontal scrollbar if present (640 is the width of the main tables, 19 is the scrollbar)
        if (window.innerWidth < 640 + 19) {
            windowHeight = window.innerHeight - 19;
        }
        else {   
            windowHeight = window.innerHeight;
        }
    }
    //For IE 6 Strict Mode
    else if (document.documentElement && document.documentElement.clientHeight) {
        windowHeight = document.documentElement.clientHeight;
    }
    //For other IE versions
    else if (document.body) {
        windowHeight = document.body.clientHeight;
    }
    return windowHeight;
}

function getWindowWidth() {

    var windowWidth = 0;

    //For all browsers except IE
    if (window.innerWidth) {
        //Compensate for the vertical scrollbar if present
        if (window.innerHeight < getPageHeight()) {
            windowWidth = window.innerWidth - 19;
        }
        else {
            windowWidth = window.innerWidth;
        }
    }
    //For IE 6 Strict Mode
    else if (document.documentElement && document.documentElement.clientWidth) {
        windowWidth = document.documentElement.clientWidth;
    }
    //For other IE versions
    else if (document.body) {
        windowWidth = document.body.clientWidth;
    }
    return windowWidth;
}

//-->