function getWindowHeight() {
	var winH = 0;
	if (typeof(window.innerHeight) == 'number') {
		winH = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			winH = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				winH = document.body.clientHeight;
			}
		}
	}
	return winH;
}
function setFoot() {
	if (document.getElementById) {
		var winH = getWindowHeight();
		if (winH > 0) {
			var mainH = document.getElementById('main').offsetHeight;
			var footElmnt = document.getElementById('foot');
			var upElmnt	=  document.getElementById('up'); 
			var footH  = footElmnt.offsetHeight;
			if (winH - (mainH + footH + 20) >= 0) {
				footElmnt.style.visibility = 'visible';
				footElmnt.style.top = (winH - (mainH + footH) - 20 ) + 'px';
				upElmnt.style.visibility = 'hidden';	
			}
			else {
				footElmnt.style.visibility = 'visible';
				footElmnt.style.top = '0';
				upElmnt.style.visibility = 'visible';				
			}
		}
	}
}
window.onload = function() {
	setFoot();
}
window.onresize = function() {
	setFoot();
}
function tog( tId ) {
	if (document.getElementById) {
		target = document.getElementById( tId );
		if (target.style.display == "none") {
			target.style.display = "";
		}
		else {
			target.style.display = "none";	
		}
	setFoot();
	}
}
