/* ResizeColumns: code with permission by Paul@YellowPencil.com and Scott@YellowPencil.com
   includes TextResizeDetector by Lawrence Carvalho <carvalho@uk.yahoo-inc.com>
   modified a bit to include multiple set of columns on one page and changed to object not set of functions
   Given a set of columns and ids it takes those columns and resizes the height to be that of the tallest.
   Necessary when using divs, floated or absolute positioning instead of tables.
*/
resizeColumns = {
setOfColumns: [],  
init:function() {
	if (!document.getElementsByTagName || !document.getElementById) { return false; }
	resizeColumns.setOfColumns[0] = new Array('leftColumn', 'mainColumn', 'rightColumn');
	resizeColumns.setOfColumns[1] = new Array('memCategoryLeftColumn', 'memCategoryMainColumn', 'memCategoryRightColumn');
	var colGroup;
	for(var i=0; i< resizeColumns.setOfColumns.length; i++) {
		colGroup = resizeColumns.setOfColumns[i];
		for (var j = 0; j < colGroup.length; j++) { 
			if (document.getElementById(colGroup[j]) != null) { 
			//	TextResizeDetector.TARGET_ELEMENT_ID = colGroup[j]; 
				break; 
			} 
		}
	}
	for(var i=0; i< resizeColumns.setOfColumns.length; i++) {
		resizeColumns.setHeight(resizeColumns.setOfColumns[i]);
	}
},
setHeight:function(setOfColumns) {
	var maxHeight = 0; 
	for (var i = 0; i < setOfColumns.length; i++) {
		if (document.getElementById(setOfColumns[i]) != null) { 
			var div = document.getElementById(setOfColumns[i]); 
			div.style.height = null; 
			if (div.offsetHeight > maxHeight) 
				maxHeight = div.offsetHeight; 
		}
	}
	for (var i = 0; i < setOfColumns.length; i++) {
		if (document.getElementById(setOfColumns[i]) != null) { 
			var div = document.getElementById(setOfColumns[i]); 
			div.style.height = maxHeight + 'px'; 
			if (div.offsetHeight > maxHeight) { 
				div.style.height = (maxHeight - (div.offsetHeight - maxHeight)) + 'px'; 
			} 
		}
	}
}
}
DOMhelp.addEvent(window,'load', resizeColumns.init, false);
