/*
 Dual licensed under the MIT and GPL licenses:
 http://www.opensource.org/licenses/mit-license.php
 http://www.gnu.org/licenses/gpl.html
*/
(function(c){function h(a){for(var b=["&","<",">",'"'],e=["&amp;","&lt;","&gt;","&quot;"],d=0;d<b.length;d++){var f=new RegExp(b[d],"gi");if(f.test(a))a=a.replace(f,e[d])}return a}function g(a,b){a=a;var e="jgrow-"+a.attr("name"),d=a.css("height");d=parseInt(d=="auto"?"50px":d);d=a.css("line-height");d=parseInt(d=="normal"?"16px":d);var f=h(a.val().replace(/\n/g,"<br />"));c("#"+e).length?c("#"+e).html(f):c("<div/>").attr("id",e).css({border:a.css("border"),"font-family":a.css("font-family"),"font-size":a.css("font-size"),
"font-weight":a.css("font-weight"),left:"-3999px",overflow:"visible",padding:a.css("padding"),position:"absolute",top:0,width:a.css("width")}).html(f).appendTo("body");e=c.browser.msie?parseInt(c("#"+e).innerHeight()):parseInt(c("#"+e).css("height"))+d;if(b.max_height!="none"&&e>parseInt(b.max_height))a.css({overflow:"auto",height:parseInt(b.max_height)+d+"px"});else if(e>b.cache_height)a.css("height",e+"px");else{b=isNaN(b.cache_height)?0:b.cache_height+"px";a.css("height",b)}}c.fn.jGrow=function(a){a=
c.extend({},c.fn.jGrow.defaults,a);this.each(function(){var b=c(this);b.css(a);b=c.browser.msie?b.innerHeight():b.css("height");b=parseInt(b);a.cache_height=b;new g(c(this),a)}).keyup(function(){new g(c(this),a)})};c.fn.jGrow.defaults={max_height:"none",resize:"none",overflow:"hidden",cache_height:0};c.fn.jGrow.VERSION="0.6.1"})(jQuery);

