function getDocSize(w){
    if(!w) w = window;
    var s = new Object();

    if (typeof document.height != 'undefined'){
        s.width =  w.document.width;
        s.height = w.document.height;
    }else{
        var obj = getBody(w);
        s.width = obj.scrollWidth;
        s.height = obj.scrollHeight;
    }
    return s;
}

////////////////////////////////////////////////////////////
// getWinSize(window)
function getWinSize(win){
    if(!win) win = window;
    var s = new Object();
    if(typeof win.innerWidth != 'undefined') {
        s.width = win.innerWidth;
        s.height = win.innerHeight;
    }else{
         var obj = getBody(win);
         s.width = parseInt(obj.clientWidth);
         s.height = parseInt(obj.clientHeight);
    }
    return s;
}

////////////////////////////////////////////////////////////
// offset(window)
function pageOffset(win){
    if(!win) win = window;
    var pos = {left:0,top:0};

    if(typeof win.pageXOffset != 'undefined'){
         // Mozilla/Netscape
         pos.left = win.pageXOffset;
         pos.top = win.pageYOffset;
    }else{
         var obj = getBody(win);
         pos.left = obj.scrollLeft;
         pos.top = obj.scrollTop;
    }
    return pos;
}


////////////////////////////////////////////////////////////
// Der IE hat 2 verschiedene Objekte für den strict und quirks Mode.
function getBody(w){
    return (w.document.compatMode && w.document.compatMode == "CSS1Compat") ? w.document.documentElement : w.document.body || null;
}
