// Extend jQuery
(function ($) {
   $.extend($.fn, {
       /**
       * Return or set the minimum height of an element
       */
       minHeight: function(size) {
           // Explorer versions prior to IE7 needs to have height instead of min-height
           var type = ($.browser.msie && parseInt($.browser.version, 10) < 7)  ? "height" : "min-height";
           if (size == undefined) {
               // Get min-height for the first element
               return this.css(type);
           } else {
               // Set the min-height on all elements (default to pixels if value is unitless)
               this.css(type, size.toString().match(/^\d+$/) ? size + "px" : size);
               return this;
           }
       },
       /**
       * Justify elements
       */
       justify: function() {
           var maxHeight = 0;
           // Get the height of the highest element
           this.each(function() {
               var el = $(this), height;
               el.minHeight(0);
               height = el.outerHeight();
               if (height > maxHeight) {
                   maxHeight = height;
               }
           });
           // Set min-height for all elements
           this.each(function () {
               var el = $(this);
               el.minHeight(el.height() + maxHeight - el.outerHeight());
           });
           return this;
       }
   });
})(jQuery);
