var getDimensions = {

// http://codylindley.com/Webdev/295/javascript-get-page-height-with-scroll
    getPageWidth:function() {

        if( window.innerHeight && window.scrollMaxY )  {   // Firefox
            pageWidth = window.innerWidth + window.scrollMaxX;
        }
        else if( document.body.scrollHeight > document.body.offsetHeight ) { // all but Explorer Mac
            pageWidth = document.body.scrollWidth;
        }
        else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
            pageWidth = document.body.offsetWidth + document.body.offsetLeft;
        }
        return pageWidth;
    },

    getPageHeight:function() {

        if( window.innerHeight && window.scrollMaxY )  {   // Firefox
            pageHeight = window.innerHeight + window.scrollMaxY;
        }
        else if( document.body.scrollHeight > document.body.offsetHeight ) { // all but Explorer Mac
            pageHeight = document.body.scrollHeight;
        }
        else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
            pageHeight = document.body.offsetHeight + document.body.offsetTop;
        }
        return pageHeight;
    },

// http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
    getWindowWidth:function() {

        var myWidth = 0;
        if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE
            myWidth = window.innerWidth;
        }
        else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
        }
        else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
            myWidth = document.body.clientWidth;
        }
        return myWidth;
    },

    getWindowHeight:function() {

        var myHeight = 0;
        if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE
            myHeight = window.innerHeight;
        }
        else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myHeight = document.documentElement.clientHeight;
        }
        else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
            myHeight = document.body.clientHeight;
        }
        return myHeight;
    }
}
