// JavaScript Document

function absTop(el) {
	return (el.offsetParent)? el.scrollTop+absTop(el.offsetParent) : el.scrollTop;
}
function bottomFix(){
	var subnavi = document.getElementById('sub-navigation');
	var bottom = document.getElementById('bottom');
	var root = document.getElementById('root');
	var diff = bottom.offsetTop - subnavi.offsetTop;
	if(bottom.offsetTop > (subnavi.offsetTop+149)){
		root.style.background = 'none';
	} else {
		if(diff <= 154){
			bottom.style.position = 'relative';
			bottom.style.top = '-29px';
			root.style.background = 'url(/fileadmin/img/assets/bg_bottom_root.gif) 0px bottom repeat-x';
		} else {
			bottom.style.position = 'absolute';
			bottom.style.top = 'inherit';
			root.style.background = 'none';
		}
	}
}

window.onload = function()
{
	bottomFix();
};

window.onresize = function()
{
	bottomFix();
};

