$.fn.prettyComments=function(e){e=jQuery.extend({animate:false,animationSpeed:"fast",maxHeight:500,alreadyAnimated:false,init:true},e);$("body").append('<div id="comment_hidden"></div>');var a=function(f){$("#comment_hidden").css({position:"absolute",top:-10000,left:-10000,width:$(f).width(),"min-height":$(f).height(),"font-family":$(f).css("font-family"),"font-size":$(f).css("font-size"),"line-height":$(f).css("line-height")});if($.browser.msie&&parseFloat($.browser.version)<7){$("#comment_hidden").css("height",$(f).height())}};var d=function(f){theValue=$(f).attr("value")||"";theValue=theValue.replace(/\n/g,"<br />");$("#comment_hidden").html(theValue+"<br />");if(!e.init){if($("#comment_hidden").height()>$(f).height()){if($("#comment_hidden").height()>e.maxHeight){$(f).css("overflow-y","scroll")}else{$(f).css("overflow-y","hidden");c(f)}}else{if($("#comment_hidden").height()<$(f).height()){if($("#comment_hidden").height()>e.maxHeight){$(f).css("overflow-y","scroll")}else{$(f).css("overflow-y","hidden");b(f)}}}}};var c=function(f){if(e.animate&&!e.alreadyAnimated){e.alreadyAnimated=true;$(f).animate({height:$("#comment_hidden").height()},e.animationSpeed,function(){e.alreadyAnimated=false})}else{if(!e.animate&&!e.alreadyAnimated){$(f).height($("#comment_hidden").height())}}};var b=function(f){if(e.animate&&!e.alreadyAnimated){e.alreadyAnimated=true;$(f).animate({height:$("#comment_hidden").height()},e.animationSpeed,function(){e.alreadyAnimated=false})}else{$(f).height($("#comment_hidden").height())}};$(this).each(function(){$(this).css({overflow:"hidden"}).bind("keyup",function(){d($(this))});a(this);d($(this));if($("#comment_hidden").height()>e.maxHeight){$(this).css({"overflow-y":"scroll",height:e.maxHeight})}else{$(this).height($("#comment_hidden").height())}e.init=false})};
