    jQuery.fn.setEqualHeight = function(o) {
    	var maxHeight = 0;
    	var maxElement = null;
     	jQuery(this).each(function(i) {

			var margin_top = jQuery(this).css("margin-top");
			var margin_bottom = jQuery(this).css("margin-bottom");
			var padding_top = jQuery(this).css("padding-top");
			var padding_bottom = jQuery(this).css("padding-bottom");
			var border_top = jQuery(this).css("borderTopWidth");
			var border_bottom = jQuery(this).css("borderBottomWidth");

			if(margin_top=='auto') margin_top = '0px';
			if(margin_bottom=='auto') margin_bottom = '0px';
			if(border_top=='medium') border_top = '0px';
			if(border_bottom=='medium') border_bottom = '0px';

          	if((jQuery(this).height() + parseInt(padding_bottom) + parseInt(padding_top) + parseInt(margin_top) + parseInt(margin_bottom) + parseInt(border_top) + parseInt(border_bottom)) > maxHeight) {
    			maxHeight = jQuery(this).height()+ parseInt(padding_top) + parseInt(padding_bottom) + parseInt(margin_top) + parseInt(margin_bottom) + parseInt(border_top) + parseInt(border_bottom);
    			maxElement = this;
    		}
    	});
    	
		jQuery(this).not($(maxElement)).each(function() {
			
			var margin_top = jQuery(this).css("margin-top");
			var margin_bottom = jQuery(this).css("margin-bottom");
			var padding_top = jQuery(this).css("padding-top");
			var padding_bottom = jQuery(this).css("padding-bottom");
			var border_top = jQuery(this).css("borderTopWidth");
			var border_bottom = jQuery(this).css("borderBottomWidth");

			if(margin_top=='auto') margin_top = '0px';
			if(margin_bottom=='auto') margin_bottom = '0px';
			if(border_top=='medium') border_top = '0px';
			if(border_bottom=='medium') border_bottom = '0px';
			
			$(this).height(maxHeight - parseInt(padding_top) - parseInt(padding_bottom) - parseInt(margin_top) - parseInt(margin_bottom) - parseInt(border_top) - parseInt(border_bottom));
		})
    }
