
function getHeightFromLayer(objStartPoint) {
	// from quirksmode?
	var intDivHeight=0;
	var objChild;
	var intTotal=0;
	var intTop=0;
	var intHeight=0;
	//alert(objStartPoint);
	for (var i=0;i<objStartPoint.childNodes.length;i++) {				
		objChild=objStartPoint.childNodes[i];
		try {
			intTop=parseInt(objChild.style.top);
			intHeight=parseInt(objChild.offsetHeight);
			if (isNaN(intTop)) intTop=0;
			if (isNaN(intHeight)) intHeight=0;
			intTotal=intTop+intHeight;		
			
			if (objChild.childNodes.length>0) {				
				intHeightChildren=getHeightFromLayer(objChild);
				if (intHeightChildren>intTotal) intTotal=intHeightChildren;
			}
			// alert(objChild.id + " height:=" + intHeight + " height children:=" + intHeightChildren);
			if (intTotal>intDivHeight) intDivHeight=intTotal;
			
		} catch(e) {
			if (intTotal>intDivHeight) intDivHeight=intTotal;
		}
	}
	//alert(intDivHeight);
	return intDivHeight;
}

function hoogteAanpassing() {
	intMax=0;
	intMax2=0;
	intFooter=0;
	intMiddel=30;
	try {		
		intHeightContent1=document.getElementById("content_main_page").offsetHeight;
		intHeightContent2=getHeightFromLayer(document.getElementById("content_main_page"));
		if (intHeightContent1>intHeightContent2) intHeightContent=(intHeightContent1) ; // 
		if (intHeightContent2>intHeightContent1) intHeightContent=(intHeightContent2) ; // 
		if (intHeightContent<400) intMax=400; 
		if (intHeightContent>intMax) intMax=(intHeightContent); // de -20 komt mogelijk vanuit de getHeightFromLayer
		if (intHeightContent>intMax) intMax=intHeightContent;
		intHeightSideKick1=getHeightFromLayer(document.getElementById("content_sidekick_1"));
		//alert("intHeightSideKickt" + intHeightSideKick1);
		if (intHeightSideKick1>intMax) intMax=intHeightSideKick1;
		intHeightSideKick2=getHeightFromLayer(document.getElementById("content_sidekick_2"));
		if (intHeightSideKick2>intMax) intMax2=intHeightSideKick2;
		if (intMax2>intMax) intMax=intMax2;
		
	} catch(e) {
	}
	
	try {	
		document.getElementById("content_main_page").style.height=intMax + "px";	
		document.getElementById("content_sidekick_1").style.height=intMax   + intMiddel  + "px";		
		document.getElementById("content_sidekick_2").style.height=intMax   + intMiddel  + "px";			
		//alert("max" + document.getElementById("content_main").style.height);
		intFooterTop=document.getElementById("content_main_page").offsetHeight + (document.getElementById("content_main_page").offsetTop);	
		document.getElementById("thefooter").style.top=intFooterTop + 'px';
		document.getElementById("thefooter").style.visibility='visible';

	
	} catch(e) {
	}
}
