var CustomTextArea_truncate=false,CustomTextAreaOCHash={};function taLength(b){if(!b){return 0}var a=b.match(/\n/g);if(a){return b.length+a.length}else{return b.length}}function limitText(e,d,a){var f="",c=0,b;e=$("#"+e);d=$("#"+d);if(e==null){return}f=e.val();c=taLength(f);if(c>a){d.parent().width(e.width());d.parent().css("background-color","#DCE7F2");d.css("color","#F11A0A");d.html("0");if(true==CustomTextArea_truncate){e.val(f.substr(0,f.length-1));return}b="spanOC"+e.attr("id");if(CustomTextAreaOCHash[b]&&CustomTextAreaOCHash[b]==true){$("#spanOC"+e.attr("id")).html("<br/>"+(Math.abs(a-c))+" character(s) over.")}else{d.parent().append('<span id="spanOC'+e.attr("id")+'" style="font-weight:bold;"><br/>'+(Math.abs(a-c))+" character(s) over.</span>");CustomTextAreaOCHash[b]=true}}else{d.html(a-c);d.parent().css("background-color","#FFFFFF");d.css("color","#98BFE7");b="spanOC"+e.attr("id");if(CustomTextAreaOCHash[b]&&CustomTextAreaOCHash[b]==true){$("#spanOC"+e.attr("id")).remove();CustomTextAreaOCHash[b]=false}}};
