var colGroups = [{elementIds: ["col1", "col2"]}, {elementIds: ["ccol1", "ccol2"]}];

function adjustColumnHeights() {
	
	for(var i = 0; i < colGroups.length; i++) {
		var cg = colGroups[i].elementIds;
		
		var fillToParentHeight = (colGroups[i] == true);
		
		// get max height
		var maxH = 1;
		
		if(typeof(colGroups[i].fillElementId) != "undefined") {
			maxH = $("#" + colGroups[i].fillElementId).height();
		}
		
		for(var j = 0; j < cg.length; j++) {
			var jc = $("#" + cg[j]);
			var colHeight = jc.outerHeight(true);

			if(colHeight > maxH) {
				maxH = colHeight;
			}
		}
		
		// set all to that height
		for(var j = 0; j < cg.length; j++) {
			var jc = $("#" + cg[j]);
			var marPadBor = jc.outerHeight(true) - jc.height();
			jc.css("height", (maxH - marPadBor) + "px");
		}
	}
	
};

$(window).bind("load",adjustColumnHeights);
// $(window).bind("resize", adjustColumnHeights);
