(function(){var $,CharacterCount;$=jQuery;CharacterCount=function(element,options){this.$element=$(element);this.options=$.extend({},$.fn.characterCount.defaults,this.$element.data(),options);this.$element.bind("keyup",$.proxy(this.count,this));this.$element.trigger("keyup")};CharacterCount.prototype.count=function(e){var $el;$el=$(this);$(this.options.counterDisplay).text(this.options.maxChars-$(e.currentTarget).val().length)};$.fn.characterCount=function(option){return this.each(function(){var $this,data,options;$this=$(this);data=$this.data("characterCount");options=typeof option==="object"&&option;if(!data){$this.data("characterCount",data=new CharacterCount(this,options))}})};$.fn.characterCount.defaults={maxChars:420,counterDisplay:$("#counter")};$.fn.characterCount.Constructor=CharacterCount}).call(this);