// Copyright Apposite
// site: http://apposite.nl

//Goes threw the childs of apropriate DIV parent.
//Gets the offsetHeight en sets the heights correctly to highest value
function checkHeight()
{	var maxHeight = 0;
	var child;
	var main_text ="main_text";
	var min_height = 554;
	maxHeight = min_height;
	//get appropriate div which hold the childs
	var parent = document.getElementById("divHolder");
	var size = parent.childNodes.length;

	for(var i =0; i < size; i++)
	{  	child = parent.childNodes[i];
		//get highest offsetHeight from children
		if(child.offsetHeight > maxHeight)
			maxHeight = child.offsetHeight;
	}
	
	//check height text DIV
	var textdiv = document.getElementById("main_text");
	
	if((textdiv.offsetHeight) > maxHeight)
		maxHeight = textdiv.offsetHeight+50;
	else if((textdiv.offsetHeight < maxHeight) && (textdiv.offsetHeight > min_height))
			maxHeight = textdiv.offsetHeight+50;
		
	//set the height correctly		
	for(var i =0; i < size; i++)
	{   child =  parent.childNodes[i];
		//alert(parent.childNodes[i].id)
		//dont set banner and escape undefined childs
		if(child.id != "banner" && child.id != null)
 		{	child.style.height = maxHeight+"px";	
 		}				
	}
	textdiv.style.height = (maxHeight-50)+"px";
}
