/**
 * @author John Sanders
 */

// jQuery Plugin for equalizing column heights.
jQuery.fn.equalizeColumns=function() {
//	alert("Autosizing " . this.size() . " columns.");
	var lowestBottom = 0
	
	this.each(function(){
		// if the "top" + "height" of this element is greater than the lowestBottom
		if (this.offsetTop + this.offsetHeight > lowestBottom) {
			lowestBottom = this.offsetTop + this.offsetHeight;
		}
	});
	this.each(function(){
		$(this).height(lowestBottom - this.offsetTop + "px");
		if (this.offsetTop + this.offsetHeight > lowestBottom) {
			$(this).height((lowestBottom - (this.offsetTop + this.offsetHeight - lowestBottom)) + "px");
		} 
	}); 
};

$(document).ready(function(){
//	alert("jQuery Loaded!");
	$(".autoHeight").equalizeColumns();
});
