"use strict";!function(t){t.fn.TextAreaExpander=function(e,a){function n(t){var e=(t=t.target||t).value.length,a=t.offsetWidth;if(e!=t.valLength||a!=t.boxWidth){(e<t.valLength||a!=t.boxWidth)&&(t.style.height="0px");var n=Math.max(t.expandMin,Math.min(t.scrollHeight,t.expandMax));t.style.overflow=t.scrollHeight>n?"auto":"hidden",t.style.height=n+"px",t.valLength=e,t.boxWidth=a}return!0}return this.each(function(){if("textarea"==this.nodeName.toLowerCase()){var i=this.className.match(/expand(\d+)\-*(\d+)*/i);this.expandMin=e||(i?parseInt("0"+i[1],10):0),this.expandMax=a||(i?parseInt("0"+i[2],10):99999),n(this),this.Initialized||(this.Initialized=!0,t(this).css("padding-top",0).css("padding-bottom",0),t(this).bind("keyup",n).bind("focus",n))}}),this},t.fn.TextAreaCounter=function(){function e(e){e=e.target||e;if(t(e).data("maxlength")){t("#jqtextarea_info_"+e.name).remove();var a=t(e).data("maxlength")-t(e).val().length;(a-=t(e).val().split("\n").length-1)<0?t(e).after("<div id='jqtextarea_info_"+e.name+"' class='right help' style='background-color:#f00;color:#fff;'>"+a+" Zeichen</div>"):t(e).after("<div id='jqtextarea_info_"+e.name+"' class='right help'>noch "+a+" Zeichen</div>")}return!0}return this.each(function(){e(this),t(this).bind("keyup",e).bind("focus",e)}),this},t(document).ready(function(){t("textarea[class*=expander]").TextAreaExpander("30","1200"),t("textarea[class*=counter],input[class*=counter]").TextAreaCounter()})}(jQuery);