function Fensterweite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

function Fensterhoehe () {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.body.clientHeight) {
    return document.documentElement.clientHeight ;
  } else {
    return 0;
  }
}

var ie5=document.all&&document.getElementById;
var ns6=document.getElementById&&!document.all;

function initLayout (start) {
	if (!OriginalHeight) OriginalHeight = getHeight('wrapper');
	if (!OriginalDiff) OriginalDiff = getYPos('footerLine');
	
	if (!Col1Height) Col1Height = getHeight('nav')+28;
	if (!Col2Height) Col2Height = getHeight('content')+28;
	if (!Col3Height) Col3Height = getHeight('emotional');
	
	if (!ContactHeight) ContactHeight = getHeight('contact') + getHeight('footer');
	if (!ContactOffset) ContactOffset = getYPos('spacer');

	
	if (start==1){
		var wrapperDiv = getObjectRef('wrapper');
		if (Col1Height>Col2Height && Col1Height>Col3Height){
			OriginalDiff=Col1Height;
		}else if (Col2Height>Col1Height && Col2Height>Col3Height){
			OriginalDiff=Col2Height+10;
		}else if (Col3Height>Col1Height && Col3Height>Col2Height){
			OriginalDiff=Col3Height;
		}
	
		wrapperDiv.style.height= (OriginalDiff) +"px";
		var newHeight = OriginalDiff;

		if(ie5) {
			newHeight = OriginalDiff;
			
		}
		var contentDiv = getObjectRef('emotional');
		contentDiv.style.height= (newHeight)+"px";
		
		
		
		
		OriginalDiff = getYPos('footerLine');
		wrapperDiv.style.height= (OriginalDiff) +"px";
		
		var spaceDiv = getObjectRef('spacer');
		spaceDiv.style.height= ((OriginalDiff-ContactOffset)-ContactHeight-20)+"px";
		
	}
	
	if (Hoehe != Fensterhoehe() || !Hoehe || start==1){
		Hoehe = Fensterhoehe();
		var newheight= Hoehe;
		var contentDiv = getObjectRef('footerGFX');
		//var content_div_diff= getHeight('warpper_main') - getHeight('page_content');		
		var newheight_page= Fensterhoehe() - OriginalDiff-12;
		if(ie5) {
			newheight_page= Fensterhoehe() - OriginalDiff-20;
		} 
		contentDiv.style.height= newheight_page +"px";
	}
}

function getHeight(name) { 
	var el = getObjectRef(name); 
	return el.offsetHeight; 
} 

function getYPos(name) { 
	var el = getObjectRef(name); 
	return el.offsetTop; 
} 



function getObjectRef(name) { 
	if(document.getElementById) return document.getElementById(name); 
	else if(document.all) return document.all[name]; 
	else return null; 
} 