$.fn.equalize = function(minHeight, maxHeight) {
       var tallest = (minHeight) ? minHeight : 0;
       function addSize(elem,baseHeight,operation) {
               var btop = parseInt(elem.css('border-top-width'));
               var bbot = parseInt(elem.css('border-bottom-width'));
               var ptop = parseInt(elem.css('padding-top'));
               var pbot = parseInt(elem.css('padding-bottom'));
               if (operation == 'subtract') {
                       if (!isNaN(ptop)) baseHeight -= ptop;
                       if (!isNaN(pbot)) baseHeight -= pbot;
                       if (!isNaN(btop)) baseHeight -= btop;
                       if (!isNaN(bbot)) baseHeight -= bbot;
               } else {
                       if (!isNaN(ptop)) baseHeight += ptop;
                       if (!isNaN(pbot)) baseHeight += pbot;
                       if (!isNaN(btop)) baseHeight += btop;
                       if (!isNaN(bbot)) baseHeight += bbot;
               }
               return baseHeight;
       }
       this.each(function() {
               var height = $(this).height();
               height = addSize($(this),height);
               if (height > tallest) tallest = height;
       });
       if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
       return this.each(function() {
               tallest2 = addSize($(this),tallest,'subtract')
       $(this).height(tallest2);
       });
}