(function($){vardivgrowid=0;$.fn.divgrow=function(options){varoptions=$.extend({},{initialHeight:100,moreText:"+ Show More",lessText:"- Show Less",speed:1e3,showBrackets:true},options);returnthis.each(function(){divgrowid++;obj=$(this);obj.css("height",options.initialHeight).css("overflow","hidden");if(options.showBrackets){obj.after('<pclass="divgrow-brackets">[…]</p><ahref="#"class="divgrow-showmore'+"divgrow-obj-"+divgrowid+'"'+"></a>")}else{obj.after('<ahref="#"class="divgrow-showmore'+"divgrow-obj-"+divgrowid+'"'+"></a>")}$("a.divgrow-showmore").html(options.moreText);$("."+"divgrow-obj-"+divgrowid).toggle(function(){varfullHeight=$(this).prevAll("div:first")[0].scrollHeight+10;$(this).prevAll("div:first").animate({height:fullHeight+"px"},options.speed,function(){if(options.showBrackets){$(this).nextAll("p.divgrow-brackets:first").fadeOut()}$(this).nextAll("a.divgrow-showmore:first").html(options.lessText)})},function(){$(this).prevAll("div:first").stop(true,false).animate({height:options.initialHeight},options.speed,function(){if(options.showBrackets){$(this).nextAll("p.divgrow-brackets:first").stop(true,false).fadeIn()}$(this).nextAll("a.divgrow-showmore:first").stop(true,false).html(options.moreText)})})})}})(jQuery);