!function(){$.utils||($.utils={});$.utils.defaultFont={fontFamily:"Arial",fontSize:14,fontColor:"#000000",fontWeight:400,fontStyle:"normal",align:"left",padding:0,lineHeight:1.1};$.utils.defaultFontFamilies=["Arial","Georgia","New Century Schoolbook","Times"];$.utils.pauseTagRegex=/[<][p][\d+\.?\d*$]{1,}[>]/g;$.utils.getTextareaHeadCursorPosition=function(t){var e=t[0];if(e){e.focus();if(void 0!==e.selectionStart)return e.selectionStart;if(document.selection){var n=document.selection.createRange();if(null==n)return e.value.length;var i=e.createTextRange(),o=i.duplicate();i.moveToBookmark(n.getBookmark());o.setEndPoint("EndToStart",i);return o.text.length}return e.value.length}};$.utils.getTextareaTailCursorPosition=function(t){var e=t[0];if(e){e.focus();if(void 0!==e.selectionEnd)return e.selectionEnd;if(document.selection){var n=document.selection.createRange();if(null==n)return e.value.length;var i=e.createTextRange(),o=i.duplicate();i.moveToBookmark(n.getBookmark());o.setEndPoint("EndToStart",i);return o.text.length}return e.value.length}};$.utils.getMarkPos=function(t,e,n){for(var i=0;6>i;i++)if(e[t-i-1]===n)return t-i-1;return!1};$.utils.addPauseTag=function(t,e){var n=t.val(),i=$.utils.getTextareaHeadCursorPosition(t),o=$.utils.getTextareaTailCursorPosition(t),r="<p"+e+">",a=$.utils.getMarkPos(i,n,"<"),l=$.utils.getMarkPos(o,n,">"),u=n.substring(0,i),s=n.substring(o,n.length);if(a&&l){u=n.substring(0,a);s=n.substring(l+1,n.length)}t.val(u+r+s);var g=t[0];g.focus();g.setSelectionRange(i,i+6);if(a&&l){g.focus();g.setSelectionRange(a,l+1)}}}();