
// Function for Search Form
function check(item)
{
	if(item.value == ""){
		item.value = item.oldVar;
	}else if(item.value == "Suchen..."){
		item.oldVar = item.value;
		item.value = "";
	}
}

/*
Fusszeile am Ende der Seite
coded by Daniel Schwarz __ www.schwarzmedia.ch
*/

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();

		if (windowHeight > 0) {
			var contentTop = document.getElementById('frame').offsetTop;
			var contentHeight = (document.getElementById('frame').offsetHeight-10);
			var totalHeight = (contentHeight+contentTop);
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight+10;
			// Wenn contentHeight kleiner als windowHeight
			if (windowHeight - (totalHeight + footerHeight) >= 0) {
				var footerPos =((windowHeight) - footerHeight);
				footerElement.style.position = 'absolute';
				footerElement.style.top = footerPos + 'px';
				footerElement.style.visibility = 'visible';
			}
			// Wenn contentHeight gr̦sser als windowHeight
			else {
			// Footer wird am Ende der Seite plaziert
			footerElement.style.visibility = 'visible';
			}
		}
	}
}

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