function layoutCols(id1, id2, id3) {
	var lc = document.getElementById(id1);
	var rc = document.getElementById(id2);
	var mc = document.getElementById(id3);
	if (lc == null || rc == null || mc == null) return;
	
	var lh = getHeight(lc);
	var rh = getHeight(rc);
	mc.style.height = Math.abs(lh - rh) + 'px';
}

function getHeight(element) {
	return getDimensions(element).height;
}

function getDimensions(element) {
    var display = element.style.display;
    if (display != 'none' && display != null)
      return { width: element.offsetWidth, height: element.offsetHeight };

    var els = element.style;
    var originalVisibility = els.visibility;
    var originalPosition = els.position;
    var originalDisplay = els.display;
    els.visibility = 'hidden';
    els.position = 'absolute';
    els.display = 'block';
    var originalWidth = element.clientWidth;
    var originalHeight = element.clientHeight;
    els.display = originalDisplay;
    els.position = originalPosition;
    els.visibility = originalVisibility;
    
	return { width: originalWidth, height: originalHeight };
};

function addOnLoad(handler) {
	if (typeof window.addEventListener != "undefined")
		window.addEventListener("load", handler, false);
	else if (typeof window.attachEvent != "undefined") {
		window.attachEvent("onload", handler);
	}
	else {
		if (window.onload != null) {
			var oldOnload = window.onload;
			window.onload = function(e) {
				oldOnload(e);
				handler();
			};
		}
		else window.onload = handler;
	}	
}
