function getWindowWidth()
{
    var docWidth = 0;
    if( typeof( window.innerWidth ) == 'number' )
    {
        //Non-IE
        docWidth = window.innerWidth;
    }
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
    {
        //IE 6+
        docWidth = document.documentElement.clientWidth;
    } 
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
    {
        //IE 4
        docWidth = document.body.clientWidth;
    }
    return docWidth;
}

function getWindowHeight()
{
    var docHeight = 0;
    if( typeof( window.innerWidth ) == 'number' )
    {
        //Non-IE
        docHeight = window.innerHeight + 2;
    }
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
    {
        //IE 6+
        docHeight = document.documentElement.clientHeight;
    } 
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
    {
        //IE 4
        docHeight = document.body.clientHeight;
    }
    return docHeight;
}
