var prettyComments={version:'1.1',options:{'animate':true,'animationSpeed':'normal','alreadyAnimed':false,'padding':30,'init':true},init:function(which){if($.browser.msie&&parseFloat($.browser.version)<7)this.options['padding']=this.options['padding']/2;prettyComments.theTextarea=$('#'+which);$('body').append('<div id="hidden_'+this.theTextarea.attr('id')+'"></div>');prettyComments.theHiddenDiv=$('#hidden_'+this.theTextarea.attr('id'));this.theHiddenDiv.css({'display':'none','width':this.theTextarea.width()+'px','font-family':this.theTextarea.css('font-family'),'font-size':this.theTextarea.css('font-size'),'line-height':this.theTextarea.css('line-height')});this.theTextarea.css({'overflow':'hidden','display':'inline'});if($.browser.msie&&parseFloat($.browser.version)<7){this.theHiddenDiv.css('height',this.theTextarea.height()+'px')}else{this.theHiddenDiv.css('min-height',this.theTextarea.height()+'px')};this.options['initialHeight']=this.theTextarea.height();this.theTextarea.bind('keyup',function(){prettyComments.copyContent()});this.copyContent()},copyContent:function(){theValue="";theValue+=this.theTextarea.attr('value');theValue=theValue.replace(new RegExp("\\n","g"),'<br />');this.theHiddenDiv.html(theValue);if(this.theHiddenDiv.height()>this.theTextarea.height()-this.options['padding']){this.expand()}else if(this.theHiddenDiv.height()<this.theTextarea.height()-this.options['padding']){this.shrink()}},expand:function(){if(this.options['animate']&&!this.options['alreadyAnimed']&&!this.options['init']){this.options['alreadyAnimed']=true;this.theTextarea.animate({'height':this.theHiddenDiv.height()+this.options['padding']},this.options['animationSpeed'],function(){prettyComments.options['alreadyAnimed']=false})}else if(!this.options['animate']&&!this.options['alreadyAnimed']&&!this.options['init']){this.theTextarea.height(this.theHiddenDiv.height()+this.options['padding'])}else if(this.options['init']){this.theTextarea.height(this.theHiddenDiv.height());this.options['init']=false}},shrink:function(){this.options['alreadyAnimed']=true;this.theTextarea.animate({'height':this.theHiddenDiv.height()+this.options['padding']},this.options['animationSpeed'],function(){prettyComments.options['alreadyAnimed']=false})}};