function addOnScroll() {
	//var htmlEl = document.getElementsByTagName('body')[0];
	//htmlEl.onscroll = function() { CheckSkyBoxPosition(); }
	//var htmlEl = document.getElementById('stranka');
	window.onscroll = function() { CheckSkyBoxPosition(); }
}

function getScrollingPosition()
{
	var position = [0, 0];
	if (typeof window.pageYOffset != 'undefined')
	{
		position = [
			window.pageXOffset,
			window.pageYOffset
		];
	}
	else if (typeof document.documentElement.scrollTop
	!= 'undefined' && document.documentElement.scrollTop > 0)
	{
		position = [
		document.documentElement.scrollLeft,
		document.documentElement.scrollTop
		];
	}
	else if (typeof document.body.scrollTop != 'undefined')
	{
		position = [
		document.body.scrollLeft,
		document.body.scrollTop
		];
	}
	return position;
}

function CheckSkyBoxPosition(){
	var skybox = document.getElementById('skybox-main');
	if(skybox){
		position = getScrollingPosition();
		
		if( position[1] > 178 ){
			//alert('fixedNeed');
			//skybox.style = "position: fixed; top: 5px";
			skybox.style.position = "fixed";
			skybox.style.top = "5px";
			//skybox.className = "fixedBox";
			
		}else{
			//alert('absoluteNeed');
			//skybox.style = "position: absolute; top: auto";
			skybox.style.position = "absolute";	
			skybox.style.top = "auto";
			//skybox.className = "absoluteBox";	
		}
		
	}
}

