function jsmarty_block_textformat(a,j,d){if(!j){return ;}var S=JSmarty.Plugin.get("php.wordwrap");var s=JSmarty.Plugin.get("php.str_repeat");var R="",w;var o=null;var Z=80;var h=null;var C=0;var z=false;var G="\n";var q=" ";var W=0;for(k in a){if(!a.hasOwnProperty(k)){continue;}switch(k){case "style":o=a[k];break;case "wrap":Z=parseInt(a[k]);break;case "assign":h=a[k];break;case "indent":C=parseInt(a[k]);break;case "wrap_cut":z=parseInt(a[k]);break;case "wrap_char":G=a[k];break;case "indent_char":q=a[k];break;case "indent_first":W=parseInt(a[k]);break;default:d.trigger_error("textformat: unknown attribute");break;}}switch(o){case "email":Z=72;break;}w=j.split(/\r?\n\r?\n/g);for(var D=0,H=w.length;D<H;D++){if(w[D]==""){continue;}w[D]=w[D].replace(/\s+/," ");w[D]=w[D].replace(/^(\s+)|(\s+)$/,"");if(W>0){w[D]=s(q,W)+w[D];}w[D]=S(w[D],Z-C,G,z);if(C>0){w[D]=w[D].replace(/^/gm,s(q,C));}}R=w.join(G+G);if(h){d.assign(h,R);R="";}return R;}