//
// Dieses Skript wird für das MasterLayout benötigt, damit die
// Grössen der Subcontainer immer auf das maximum setzt.
//

if (document.getElementById || document.all) { // minimum dhtml support required
	window.onload = winOnLoad;
}

	
function winOnLoad() {
	//var ele = xGetElementById('MasterLayout');
 	//if (ele && xDef(ele.style, ele.offsetHeight)) { // another compatibility check
    		adjustLayout();
	  	xAddEventListener(window, 'resize', winOnResize, false);
  	//}
}

	
function winOnResize() {
	adjustLayout();
}


function adjustLayout() {
	doAdjustLayout('MasterLayout');
	doAdjustLayout('NoActionPaneMasterLayout');

}
	
function doAdjustLayout(prefix) {
	
 	// Get content heights
	var heightLeft = xHeight(prefix + 'Left');
	var heightCenter = xHeight(prefix + 'Center');
	var heightRight = xHeight(prefix + 'Right');
 		
	var maxHeight = Math.max(heightLeft, heightCenter);
	maxHeight = Math.max(maxHeight, heightRight);		
		
		
	// Assign maximum height to Right and Left
	xHeight(prefix + 'Right', maxHeight);
	xHeight(prefix + 'Left', maxHeight);
	xHeight(prefix + 'Center', maxHeight);	
}