/**
 * Adjusts two columns of variable height so that their
 * resulting height is identical.
 * 
 * NOTE: relies on the Prototype javascript library
 */
function fix_two_column_height(c1, c2) {
	var p = ['padding-top', 'padding-bottom', 'margin-top'];

	var c1_adjust = p.inject(0, function(sum, prop) { var p = parseInt($(c1).getStyle(prop)); return sum + (isNaN(p)) ? 0 : p; });
	var c2_adjust = p.inject(0, function(sum, prop) { var p = parseInt($(c2).getStyle(prop)); return sum + (isNaN(p)) ? 0 : p; });
	if ( $(c1).getHeight() + c1_adjust > $(c2).getHeight() + c2_adjust) {
		$(c2).style.height = 'auto';
		$(c2).style.height = parseInt($(c1).offsetHeight + c1_adjust - c2_adjust) + 'px';
	}
}
