
/* =====----------------------------------------===== */
/* ====   Funkce pro IE k ziskani pozice prvku   ==== */
/* =====----------------------------------------===== */

function el_getPageOffsetLeft (el) {
	var ol = el.offsetLeft;
	while ((el = el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
}


/* =====---------------------------------===== */

function el_getWindowOffsetLeft (el) {
	return el_getPageOffsetLeft(el) - document.body.scrollLeft;
}


/* =====---------------------------------===== */

function el_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el = el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
}


/* =====---------------------------------===== */

function el_getWindowOffsetTop (el) {
	return el_getPageOffsetTop(el) - document.body.scrollTop;
}



/* =====-------------------------------------===== */
/* ====   Pozicovani a fixovani SkyScraperu   ==== */
/* =====-------------------------------------===== */
/*
function SkyStyle() {


	document.write ('<style>');
	document.write ('.SkyScraper {');
	document.write ('left\:'+ x +'px\;');
	document.write ('}');
	document.write ('<\/style>');

}

SkyStyle();
*/
/* =====---------------------------------===== */

function getMyPoz() {

	var scrOfY = 0;

	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
	}

	return scrOfY;
}


/* =====---------------------------------===== */

function fixedEl(id) {

	if (gEBI(id)) {
		//alert('OK');

		var myY = getMyPoz();
		var ww = window.screen.width - 950;
		var x = ww / 2 + 948;

		if (myY > 128) {
			gEBI(id).style.position = 'fixed';
			gEBI(id).style.top = 2 + 'px';
			gEBI(id).style.left = x + 'px';
		} else {
			gEBI(id).style.position = 'absolute';
			gEBI(id).style.top = document.body.scrollTop + 130 + 'px';
			gEBI(id).style.left = '0px';
		}

	}

}


