function realBody()
{
    return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clientWidth()
{
    var body = realBody();
    return document.all ? body.scrollLeft + body.clientWidth : window.innerWidth;
}

function clientHeight()
{
    var body = realBody();
    return document.all ? Math.min(body.scrollHeight, body.clientHeight) : Math.min(window.innerHeight);
}