
//	jQuery setEqualBlocksHeight 2.0
//	by Sergei T.

(function($){$.fn.setEqualBlocksHeight=function(c){var d={count:'all',allowPadding:true,maxHeight:0,checkingTime:1,delayBetweenChecking:1};var e=this;e.div=$('<div/>');e.div.maxHeight=0;e.div.oldMaxHeight=0;e.options=$.extend({},d,c);if(e.options.count=='all'||e.options.count>e.length)e.options.count=e.length;e.options.count=parseInt(e.options.count);function getItemHeight(a){return e.options.allowPadding?$(a).innerHeight():$(a).height()};if(e.options.count>1){var f=0;var g=setInterval(function(){e.div.maxHeight=0;for(var i=1;i<=e.length;i+=e.options.count){var a=0;for(var j=0;j<=e.options.count-1;j++)if(e.get(i+j-1)){e.eq(i+j-1).css({height:'auto','min-height':0});a=Math.max(getItemHeight(e.eq(i+j-1)),a)}e.div.maxHeight=Math.max(e.div.maxHeight,a);for(var j=0;j<=e.options.count-1;j++)if(e.get(i+j-1)){var b=e.options.allowPadding?parseInt(e.eq(i+j-1).css('padding-top'),10)+parseInt(e.eq(i+j-1).css('padding-bottom'),10):0;e.eq(i+j-1).css({'min-height':a-b});if($.browser.msie&&$.browser.version=='6.0')e.eq(i+j-1).height(a-b)}}if(e.div.maxHeight!=e.div.oldMaxHeight){e.div.oldMaxHeight=e.div.maxHeight;e.div.trigger('change')}else{e.div.oldMaxHeight=e.div.maxHeight};f+=e.options.delayBetweenChecking; if(e.options.checkingTime!='always'){if(f>=e.options.checkingTime)clearInterval(g)}},e.options.delayBetweenChecking)};if(e.options.count==1)e.css({height:'auto','min-height':0});return e.div}})(jQuery);
