/*!
 * elasticize.js v2.5.0 - 07 August, 2013
 * By Amsul (http://amsul.ca)
 * Hosted on https://github.com/amsul/elasticize.js
 * Licensed under MIT ("expat" flavour) license.
 */
(function(b){var a=function(e,m){var n=0,j=0,f=0,i=0,k=e.css("overflowY","scroll")[0],h=e.clone().attr({tabindex:-1,disabled:true,name:""}),c=b.extend({},b.fn.elasticize.defaults,m),d=function(){h.val(k.value+Array(c.charsPadding+1).join("_")+Array(c.linesPadding+1).join("\n"));i=h[0].scrollHeight+f;if(n!=i){n=i;e.outerHeight(i+"px")}},l=function(){setTimeout(d,0)},g=function(){e.css({resize:"none",transition:"height "+c.transition+"s linear"}).on({"keydown keyup change cut":d,"input paste":l}).after(h.wrap('<div style="height:0;overflow:hidden">').parent());j=h.val("").outerHeight();f=Math.abs(h[0].scrollHeight-j);n=j+f;h.css({height:j+"px"});l();return{update:d}};return new g()};b.fn.elasticize=function(c){return this.each(function(){var d=b(this);if(this.type=="textarea"&&!d.data("elasticized")){d.data("elasticized",new a(d,c))}return this})};b.fn.elasticize.defaults={charsPadding:10,linesPadding:1,transition:0.15}})(jQuery);