function sniffIE()
{
    var sAgent = navigator.userAgent

	var isIE = (sAgent.indexOf("MSIE")  > -1)

	return isIE;
}

function getAbsolutePos(el) 
{
	var r = { x: el.offsetLeft, y: el.offsetTop };
	if (el.offsetParent) 
	{
	    var tmp = getAbsolutePos(el.offsetParent);
	    r.x += tmp.x;
	    r.y += tmp.y;
	 }
	 return r;
}

function getClientBounds()
{
    var clientWidth;
    var clientHeight;
    
    if( sniffIE() )
    {
        clientWidth = document.documentElement.clientWidth;
        clientHeight = document.documentElement.clientHeight;
    }
    else
    {
        clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
        clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
    }
    
    var r = { width: clientWidth, height:clientHeight  };     
    return r;
}
