(function($){$.fn.extend({elastic:function(){var i=new Array('paddingTop','paddingRight','paddingBottom','paddingLeft','fontSize','lineHeight','fontFamily','width','fontWeight');return this.each(function(){if(this.type=='textarea'){var b=$(this);var c=parseInt(b.css('lineHeight'),10)||parseInt(b.css('fontSize'),'10');var d=parseInt(b.css('height'),10)||c*3;var e=parseInt(b.css('max-height'),10)||0;var f=0;var g=null;var h=true;if(e<0)e=0;if(!g){g=$('
').css({'position':'absolute','display':'none'}).appendTo(b.parent());$.each(i,function(){g.css(this.toString(),b.css(this.toString()))})};function update(){var a=b.val().replace(/<|>/g,' ').replace(/\n/g,'