/**
 * A simple jQuery plugin that adjusts the height of a textarea as its content
 * grows.
 *
 * @author Fortunato Geelhoed <fortunato@crudigital.com.au>
 */
(function($){$.fn.dynTextarea=function(options){var element=$(this);var defaults={height:160,limitHeight:true,maxHeight:300,debug:false};options=$.extend(defaults,options);var initialize=function(){if($.meta){options=$.extend({},options,this.data());}
element.css({'height':options.height+'px','overflow':'hidden'});element.bind('keyup',function(){if(options.limitHeight&&this.scrollHeight>options.maxHeight){$(this).css({'height':options.maxHeight+'px','overflow':'auto'});return;}
$(this).css({'height':options.height+'px','overflow':'hidden'});if(this.scrollHeight>options.height){$(this).css('height',this.scrollHeight+'px');}});}
var log=function(data){if(options.debug){try{console.log("%o: %o",data,this);}catch(e){$('BODY').append($("<div class='error'>"+data+"</div>"));}}};initialize();return this;}})(jQuery);