// Wysokość zawartości całego okna
window.getContentHeight = function()
{
	if (document.documentElement && document.documentElement.scrollHeight)
		return document.documentElement.scrollHeight;
	else if (document.body && document.body.scrollHeight)
		return document.body.scrollHeight;
	return false;
}

// Szerokość zawartości całego okna
window.getContentWidth = function()
{
	if (document.documentElement && document.documentElement.scrollWidth)
		return document.documentElement.scrollWidth;
	else if (document.body && document.body.scrollWidth)
		return document.body.scrollWidth;
	return false;
}

// Wysokość okna przeglądarki
window.getWindowHeight = function()
{
	if (window.innerHeight)
		return window.innerHeight;
	else if(document.documentElement && document.documentElement.clientHeight)
		return document.documentElement.clientHeight;
	else if (document.body && document.body.clientHeight)
		return document.body.clientHeight;
	else if(document.body && document.body.scrollHeight)
		return document.body.scrollHeight;
	return false;
}

// Szerokość okna przeglądarki
window.getWindowWidth = function()
{
	if (window.innerWidth)
		return window.innerWidth;
	else if(document.documentElement && document.documentElement.clientWidth)
		return document.documentElement.clientWidth;
	else if (document.body && document.body.clientWidth)
		return document.body.clientWidth;
	else if(document.body && document.body.scrollWidth)
		return document.body.scrollWidth;
	return false;
}

// pobiera położenie scrolla poziomego
window.getScrollX = function()
{
	if(document.documentElement && document.documentElement.scrollLeft)
		return document.documentElement.scrollLeft;
	else if(document.body && document.body.scrollLeft)
		return document.body.scrollLeft;
	else if( window.pageXOffset )
		return window.pageXOffset;
	else if( window.scrollX )
		return window.scrollX;
	return 0;
}

// pobiera położenie scrolla pionowego
window.getScrollY = function()
{
	if(document.documentElement && document.documentElement.scrollTop)
		return document.documentElement.scrollTop;
	else if(document.body && document.body.scrollTop)
		return document.body.scrollTop;
	else if( window.pageYOffset )
		return window.pageYOffset;
	else if( window.scrollY )
		return window.scrollY;
	return 0;
}

// zwraca wysokość obiektu el
window.getObjectHeight = function(el)
{
	if (!el) return false;
	if (el.style && el.style.height)
		return el.style.height;
	else if (el.offsetHeight)
		return el.offsetHeight;
	return 0;
}

// zwraca szerokość obiektu el
window.getObjectWidth = function(el)
{
	if (!el) return false;
	if (el.style && el.style.width)
		return el.style.width;
	else if (el.offsetWidth)
		return el.offsetWidth;
	return 0;
}

// pobiera pozycje x,y  - wskaznika myszy
window.getMouseXY = function(e) {
	res = new Array();
	IE = new RegExp('Internet Explorer$').test(navigator.appName)?true:false;
	if (IE)
	{
		res[0] = event.clientX + document.documentElement.scrollLeft;
		res[1] = event.clientY + document.documentElement.scrollTop;
	}
	else
	{
		res[0] = e.pageX;
		res[1] = e.pageY;
	}
	if (res[0] < 0){res[0] = 0;}
	if (res[1] < 0){res[1] = 0;}
	res['height'] = res[1];
	res['width'] = res[0];
	return res;
}

