var client = {
    getClient: function() { 
        return { scrollX: this.scrollLeft(), scrollY: this.scrollTop(), winW: this.windowWidth(), winH: this.windowHeight(), pageW: this.pageWidth(), pageH: this.pageHeight() };
    },
    getScroll: function() { return { left: this.scrollLeft(), top: this.scrollTop() }; },
    getWindow: function() { return { width: this.windowWidth(), height: this.windowHeight() }; },
    getPage:   function() { return { width: this.pageWidth(), height: this.pageHeight() }; },
    getMouse:  function(e) { return { x: this.mouseX(e), y: this.mouseY(e) }; },
    scrollLeft: function() { return Math.max(document.documentElement.scrollLeft,document.body.scrollLeft); },
    scrollTop: function() { return Math.max(document.documentElement.scrollTop,document.body.scrollTop); },
    windowWidth: function() { return Math.max(document.documentElement.clientWidth,document.body.clientWidth); },
    windowHeight: function() { return Math.max(document.documentElement.clientHeight,document.body.clientHeight); },
    pageWidth: function() { return Math.max(document.documentElement.scrollWidth,document.body.scrollWidth); },
    pageHeight: function() { return Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); },
    mouseX: function(e) { return Math.max(navigator.userAgent.toLowerCase().indexOf('msie'),0) ? event.clientX+Math.max(document.documentElement.scrollLeft,document.body.scrollLeft) : e.pageX; },
    mouseY: function(e) { return Math.max(navigator.userAgent.toLowerCase().indexOf('msie'),0) ? event.clientY+Math.max(document.documentElement.scrollTop,document.body.scrollTop) : e.pageY; },
    mouseOver: function(e) { return Math.max(navigator.userAgent.toLowerCase().indexOf('msie'),0) ? event.srcElement : e.target; }
};

function getRealPos(obj,parentid,xy) {
    x=0;
    y=0;
    if (obj) {
        x = obj.offsetLeft;
        y = obj.offsetTop - obj.parentNode.scrollTop;
        while (obj = obj.offsetParent) {
            if (obj.id == parentid) {
                continue;
            }
            x = x + obj.offsetLeft;
            y = y + obj.offsetTop;
        }
    }
    return (xy == 'x' ? x : y);
}

