function $(id) {
	return document.getElementById(id);
}

/* Cufon */
Cufon.replace('h1');
Cufon.replace('h2');


window.onload = function() {
	if ($('search2_showForm-text')) {
		$('search2_showForm-text').value = "Suchbegriff";
		
		$('search2_showForm-text').onfocus = function() {
			if (this.value == "Suchbegriff") {
				this.value = "";	
			}
		}
		
		$('search2_showForm-text').onblur = function() {
			if (this.value == "") {
				this.value = "Suchbegriff";	
			}
		}
		
	}
	
	if ($('restricted-user')) {
		$('restricted-user').focus();
	}
	
	if ($('keyvis') != null)
		calcContentHeight();
};

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 parseInt(windowHeight);
}
 	
function calcContentHeight() {
	var windowHeight = getWindowHeight();
	if (parseInt(document.body.scrollHeight) > windowHeight) {
		$('keyvis').style.height = parseInt(document.body.scrollHeight) + 'px';
	} else {
		$('keyvis').style.height = windowHeight + 'px';
	}

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