/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

(function($){
	$.fn.equalHeights = function(options){


		var defaults = {
			minHeight:0,
			maxHeight:Number.MAX_VALUE
		};

		options = $.extend(defaults, options);

		//we need to first iterate through the elements and find the tallest one
		var tallestElementHeight = 0;
		this.each(function(){
			var el = $(this);
			var height = el.outerHeight();
			if(height > tallestElementHeight ) tallestElementHeight = height;

		});

		if(tallestElementHeight < options.minHeight) tallestElementHeight = options.minHeight;
		if(options.maxHeight && tallestElementHeight > options.maxHeight) tallestElementHeight = options.maxHeight;
		this.height(tallestElementHeight);

	}


}(jQuery))


