
//
// Urheberrecht (c) 2008 Asklepios
// Alle Rechte vorbehalten
// Erstellt am: 05.06.2008
// Autor: M
//
// Funktionen, die für alle Seiten zur Verfügung stehen.
//
// ***
//
// LETZTES UPDATE: DD.MM.YYYY, Beschreibung
//

DHTML = (document.getElementById || document.all || document.layers);
if (DHTML) {


/* Welcher Browser wird verwendet? */
var TRIDENT_BROWSER, GECKO_BROWSER;
TRIDENT_BROWSER = GECKO_BROWSER = false;
if (navigator.appName == "Netscape") {
	GECKO_BROWSER = true;
}
else if (navigator.appName == "Microsoft Internet Explorer") {
	TRIDENT_BROWSER = true;
}
else ;



/* Adds an event to window.onload without overwriting currently
 * assigned onload functions.
 * Function found at Simon Willison's weblog - 
 *	  http://simon.incutio.com/ */
function
add_load_event (func)
{
	var old_onload  = window.onload;

	if (typeof window.onload != 'function') {
		window.onload   = func;
	} 
	else {
		window.onload   = function () {
			old_onload ();
			func ();
		}
	}
}



/* Setzt die Höhe des Footers. */
function
init_footer ()
{
	var fenster_hoehe = (TRIDENT_BROWSER) 
		? document.body.clientHeight 
		: window.innerHeight;

	var hoehe_gesamt = (fenster_hoehe > document.body.offsetHeight)
		? fenster_hoehe
		: document.body.offsetHeight;

	var footer_hoehe = 
		hoehe_gesamt
		- document.getElementById("kober").offsetHeight
		- document.getElementById("haber").offsetHeight
		- 4
		+ document.getElementById("footer").offsetHeight;

	if (GECKO_BROWSER) {
		footer_hoehe -= 11;
	}

	if (footer_hoehe > 0) {
		document.getElementById("footer").style.height = footer_hoehe+"px";
	}
}



add_load_event (init_footer);
window.onresize = function () {init_footer ();}



} /* if DHTML */


