// Tim Reeves JavaScript for vertical centering, Stand 2006-02-26

// FAUSTREGEL: READ an attribute and SET a style (with a text string) !!!

var nutzHoehe = 0;

function getElemId(ident) {
 var Elem;
 if (document.getElementById) { // DOM; IE5, NS6, Mozilla, Opera
     if (typeof document.getElementById(ident) == "object")
     Elem = document.getElementById(ident);
     else Elem = void(0);
     }
 else if (document.all) { // Proprietary DOM; IE4
     if (typeof document.all[ident] == "object")
     Elem = document.all[ident];
     else Elem = void(0);
   }
 else if (document[ident]) { //Netscape alternative
     Elem = document[ident];
   }
 else Elem = void(0);
 return(Elem);
}

function getClientHeight() {
	/* Get the EFFECTIVE client height of an object, i.e. excluding any scrollbar */
	/* Note that offsetHeight (a) includes any scrollbar, and (b) in older browsers */
	/* is only available for the window itself (and maybe document.body) so in fact */
	/* our only chance is to see if the browser provides clientHeight or just give up */
	var curHeight = 0;
	var myDiv=getElemId('alles');
	if (myDiv != null && typeof myDiv.clientHeight == 'number') {
		curHeight = myDiv.clientHeight;
		}
	return curHeight;
}

function neuAufbau() {
	/* Note that setting 'height' (if the object has that attribute) does not change */
	/* the objects clientHeight (that which is bequethed), but clientHeight is read only */
	var tHoehe = getClientHeight();
	if (nutzHoehe != tHoehe) {
		nutzHoehe = tHoehe;
		getElemId('mitte').style.height = nutzHoehe + 'px';
	}
	return;
}

function startUp() {
	var tHoehe = getClientHeight();
	if (tHoehe > 0) {
		neuAufbau();
		window.onresize = neuAufbau;
	}
	return;
}

