
//
// Cross-browser support
//
function getScrollLeft()
{
    if (document.all && typeof document.body.scrollLeft != "undefined") 
    {
		return (document.compatMode != "CSS1Compat") ? document.body.scrollLeft : document.documentElement.scrollLeft;
	}
	else
	{
		return (window.pageXOffset);
	}
}

function getScrollTop()
{
    if (document.all && typeof document.body.scrollTop != "undefined") 
    {
		return (document.compatMode != "CSS1Compat") ? document.body.scrollTop : document.documentElement.scrollTop;
	}
	else
	{
		return (window.pageYOffset);
	}
}

function getClientWidth()
{
    if (document.all && typeof document.body.scrollTop != "undefined") 
    {
		return (document.compatMode != "CSS1Compat") ? document.body.clientWidth : document.documentElement.clientWidth;
	}
	else
	{
		return (window.innerWidth);
	}
}

function getClientHeight()
{
    if (document.all && typeof document.body.scrollTop != "undefined") 
    {
		return (document.compatMode != "CSS1Compat") ? document.body.clientHeight : document.documentElement.clientHeight;
	}
	else
	{
		return (window.innerHeight);
	}
}

function getEventTarget(event)
{
    if (document.all) 
    {
        return event.srcElement;
    }
    else
    {
        return event.target;
    }
}

function XY(x, y)
{
	this.X = x;
	this.Y = y;
}

function WH(w, h)
{
	this.W = w;
	this.H = h;
}

WH.prototype = {
    Add : function(size) {
	    this.W += (+size.W);
	    this.H += (+size.H);
    }
}

function TRBL(t,r,b,l)
{
	this.L = l;
	this.B = b;
	this.R = r;
	this.T = t;
}

