function divHeight(divName) {
	docObj = document.getElementById(divName);
	return parseInt(docObj.offsetHeight);
}

function setHeight() {bHeight=0;sHeight=0;	
	if (!document.getElementById('breadcrumbs')) {
		bHeight=0;	
	} else {
		bHeight=divHeight('breadcrumbs')+10;
	}

	if (!document.getElementById('submenu')) {
		sHeight=0;	
	} else {
		sHeight=divHeight('submenu');
	}

	cHeight=divHeight("content")+bHeight+sHeight;
	tHeight=divHeight("tree");

	if (cHeight != tHeight) {
		if (tHeight > cHeight) {
			document.getElementById("content").style.height=tHeight+'px';
		} else if (cHeight < 400) {
			document.getElementById("tree").style.height=400+bHeight+sHeight+'px';
			document.getElementById("content").style.height=400+'px';
		} else if (cHeight > tHeight) {
			document.getElementById("tree").style.height=cHeight+'px';
		} 
		setTimeout('setHeight()',250);
	}
}
setHeight();
