You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Prowlarr/NzbDrone.Web/Scripts/2011.1.414/telerik.editor.min.js

1 line
69 KiB

(function(s){var ar=s.telerik;function G(a3){var a2={};for(var a1=0;a1<a3.length;a1++){a2[a3[a1]]=true}return a2}var aM=G("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(","));var H="div,p,h1,h2,h3,h4,h5,h6,address,applet,blockquote,button,center,dd,dir,dl,dt,fieldset,form,frameset,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,pre,script,table,tbody,td,tfoot,th,thead,tr,ul".split(",");var N=G(H);var aU=G("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var".split(","));var M=G("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(","));var g=function(a1){if(a1.nodeType==1){a1.normalize()}};if(s.browser.msie&&parseInt(s.browser.version)>8){g=function(a2){if(a2.nodeType==1&&a2.firstChild){var a1=a2.firstChild,a3=a1;while(a3=a3.nextSibling){if(a3.nodeType==3&&a1.nodeType==3){a3.nodeValue=a1.nodeValue+a3.nodeValue;D.remove(a1)}a1=a3}}}}function p(a1){var a2=0;while(a1=a1.previousSibling){a2++}return a2}function af(a1){return a1&&a1.nodeValue!==null&&a1.data!==null}function k(a1,a2){try{return !af(a1)&&(s.contains(a1,af(a2)?a2.parentNode:a2)||a2.parentNode==a1)}catch(a3){return false}}function z(a2,a1){return k(a2,a1)||a2==a1}function aB(a2,a1){if(k(a2,a1)){while(a1&&a1.parentNode!=a2){a1=a1.parentNode}}return a1}function aG(a1){return af(a1)?a1.length:a1.childNodes.length}function av(a1,a3){var a2=a1.cloneNode(false);a1.deleteData(a3,a1.length);a2.deleteData(0,a3);D.insertAfter(a2,a1)}function B(a2,a3){for(var a4 in a3){var a1=a2[a4];if(a4=="float"){a1=a2[s.support.cssFloat?"cssFloat":"styleFloat"]}if(typeof a1=="object"){if(!B(a1,a3[a4])){return false}}else{if(a1!=a3[a4]){return false}}}return true}var aD=/^\s+$/;var e=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i;var ah=("color,padding-left,padding-right,padding-top,padding-bottom,background-color,background-attachment,background-image,background-position,background-repeat,border-top-style,border-top-width,border-top-color,border-bottom-style,border-bottom-width,border-bottom-color,border-left-style,border-left-width,border-left-color,border-right-style,border-right-width,border-right-color,font-family,font-size,font-style,font-variant,font-weight,line-height").split(",");var D={blockParentOrBody:function(a1){return D.parentOfType(a1,H)||a1.ownerDocument.body},normalize:g,toHex:function(a1){var a2=e.exec(a1);if(!a2){return a1}return"#"+s.map(a2.slice(1),function(a3){return a3=parseInt(a3).toString(16),a3.length>1?a3:"0"+a3}).join("")},encode:function(a1){return a1.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00a0/g,"&nbsp;")},name:function(a1){return a1.nodeName.toLowerCase()},significantChildNodes:function(a1){return s.grep(a1.childNodes,function(a2){return a2.nodeType!=3||!D.isWhitespace(a2)})},lastTextNode:function(a2){if(a2.nodeType==3){return a2}var a1=null;for(var a3=a2.lastChild;a3;a3=a3.previousSibling){if(a1=D.lastTextNode(a3)){return a1}}return a1},is:function(a1,a2){return D.name(a1)==a2},isMarker:function(a1){return a1.className=="t-marker"},isWhitespace:function(a1){return aD.test(a1.nodeValue)},isBlock:function(a1){return N[D.name(a1)]},isEmpty:function(a1){return aM[D.name(a1)]},isInline:function(a1){return aU[D.name(a1)]},scrollTo:function(a1){a1.ownerDocument.body.scrollTop=s(af(a1)?a1.parentNode:a1).offset().top},insertAt:function(a2,a1,a3){a2.insertBefore(a1,a2.childNodes[a3]||null)},insertBefore:function(a1,a2){if(a2.parentNode){return a2.parentNode.insertBefore(a1,a2)}else{return a2}},insertAfter:function(a1,a2){return a2.parentNode.insertBefore(a1,a2.nextSibling)},remove:function(a1){a1.parentNode.removeChild(a1)},trim:function(a2){for(var a1=a2.childNodes.length-1;a1>=0;a1--){var a3=a2.childNodes[a1];if(af(a3)){if(a3.nodeValue.replace(/\ufeff/g,"").length==0){D.remove(a3)}if(D.isWhitespace(a3)){D.insertBefore(a3,a2)}}else{if(a3.className!="t-marker"){D.trim(a3);if(a3.childNodes.length==0&&!D.isEmpty(a3)){D.remove(a3)}}}}return a2},parentOfType:function(a1,a2){do{a1=a1.parentNode}while(a1&&!(D.ofType(a1,a2)));return a1},ofType:function(a1,a2){return s.inArray(D.name(a1),a2)>=0},changeTag:function(a5,a2){var a4=D.create(a5.ownerDocument,a2);var a8=a5.attributes;for(var a3=0;a3<a8.length;a3++){var a6=a8[a3];if(a6.specified){var a7=a6.nodeName;var a1=a6.nodeValue;if(a7=="class"){a4.className=a1}else{if(a7=="style"){a4.style.cssText=a5.style.cssText}else{a4.setAttribute(a7,a1)}}}}while(a5.firstChild){a4.appendChild(a5.firstChild)}D.insertBefore(a4,a5);D.remove(a5);return a4},wrap:function(a1,a2){D.insertBefore(a2,a1);a2.appendChild(a1);return a2},unwrap:function(a1){var a2=a1.parentNode;while(a1.firstChild){a2.insertBefore(a1.firstChild,a1)}a2.removeChild(a1)},create:function(a3,a2,a1){return D.attr(a3.createElement(a2),a1)},attr:function(a1,a2){a2=s.extend({},a2);if(a2&&"style" in a2){D.style(a1,a2.style);delete a2.style}return s.extend(a1,a2)},style:function(a1,a2){s(a1).css(a2||{})},unstyle:function(a2,a1){for(var a3 in a1){if(a3=="float"){a3=s.support.cssFloat?"cssFloat":"styleFloat"}a2.style[a3]=""}if(a2.style.cssText==""){a2.removeAttribute("style")}},inlineStyle:function(a2,a5,a6){var a3=D.create(a2,a5,a6);a2.body.appendChild(a3);var a1=s(a3);var a4=s.map(ah,function(a7){if(s.browser.msie&&a7=="line-height"&&a1.css(a7)=="1px"){return"line-height:1.5"}else{return a7+":"+a1.css(a7)}}).join(";");a1.remove();return a4},commonAncestor:function(){var a4=arguments.length;if(!a4){return null}if(a4==1){return arguments[0]}var a5=[];var a6=Infinity;for(var a1=0;a1<a4;a1++){var a8=[];var a9=arguments[a1];while(a9){a8.push(a9);a9=a9.parentNode}a5.push(a8.reverse());a6=Math.min(a6,a8.length)}if(a4==1){return a5[0][0]}var a7=null;for(a1=0;a1<a6;a1++){var a3=a5[0][a1];for(var a2=1;a2<a4;a2++){if(a3!=a5[a2][a1]){return a7}}a7=a3}return a7}};var r="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),K=/"/g;function C(a3){var a6=[];var a5={"telerik:script":{start:function(a7){a6.push("<script");a2(a7);a6.push(">")},end:function(){a6.push("</script>")}},b:{start:function(){a6.push("<strong>")},end:function(){a6.push("</strong>")}},i:{start:function(){a6.push("<em>")},end:function(){a6.push("</em>")}},u:{start:function(){a6.push('<span style="text-decoration:underline;">')},end:function(){a6.push("</span>")}},font:{start:function(a9){a6.push('<span style="');var a7=a9.getAttribute("color");var a8=r[a9.getAttribute("size")];var ba=a9.getAttribute("face");if(a7){a6.push("color:");a6.push(D.toHex(a7));a6.push(";")}if(ba){a6.push("font-face:");a6.push(ba);a6.push(";")}if(a8){a6.push("font-size:");a6.push(a8);a6.push(";")}a6.push('">')},end:function(a7){a6.push("</span>")}}};function a2(a8){var bf=[],bn=a8.attributes,bk=s.trim;if(D.is(a8,"img")){var bq=a8.style.width,bg=a8.style.height,be=s(a8);if(bq){be.attr("width",parseInt(bq));D.unstyle(a8,{width:undefined})}if(bg){be.attr("height",parseInt(bg));D.unstyle(a8,{height:undefined})}}for(var bd=0,bi=bn.length;bd<bi;bd++){var bh=bn[bd];var ba=bh.nodeName;if(bh.specified||(ba=="value"&&a8.value!="")||(ba=="type"&&bh.nodeValue=="text")){if(ba.indexOf("_moz")<0&&ba!="complete"){bf.push(bh)}}}if(!bf.length){return}bf.sort(function(br,bs){return br.nodeName>bs.nodeName?1:br.nodeName<bs.nodeName?-1:0});for(var bd=0,bi=bf.length;bd<bi;bd++){var bh=bf[bd];var bp=bh.nodeName;var bj=bh.nodeValue;a6.push(" ");a6.push(bp);a6.push('="');if(bp=="style"){var bb=bk(bj||a8.style.cssText).split(";");for(var bl=0,bc=bb.length;bl<bc;bl++){var bo=bb[bl];if(bo.length){var bm=bo.split(":");var a9=bk(bm[0].toLowerCase()),a7=bk(bm[1]);if(a9.indexOf("color")>=0){a7=D.toHex(a7)}if(a9.indexOf("font-family")>=0){a7=a7.replace(K,"'")}a6.push(a9);a6.push(":");a6.push(a7);a6.push(";")}}}else{if(bp=="src"||bp=="href"){a6.push(a8.getAttribute(bp,2))}else{a6.push(M[bp]?bp:bj)}}a6.push('"')}}function a1(a7,a8){for(var a9=a7.firstChild;a9;a9=a9.nextSibling){a4(a9,a8)}}function a4(ba,bb){var be=ba.nodeType;if(be==1){if(ba.attributes._moz_dirty&&D.is(ba,"br")){return}var a8=D.name(ba);var bc=a5[a8];if(bc){bc.start(ba);a1(ba);bc.end(ba);return}a6.push("<");a6.push(a8);a2(ba);if(aM[a8]){a6.push(" />")}else{a6.push(">");a1(ba,bb||D.is(ba,"pre"));a6.push("</");a6.push(a8);a6.push(">")}}else{if(be==3){var a7=ba.nodeValue;if(!bb&&s.support.leadingWhitespace){var bd=ba.parentNode;var a9=(D.isInline(bd)?bd:ba).previousSibling;if(!a9||a9.innerHTML==""||D.isBlock(a9)){a7=a7.replace(/^[\r\n\v\f\t ]+/,"")}a7=a7.replace(/ +/," ")}a6.push(D.encode(a7))}else{if(be==4){a6.push("<![CDATA[");a6.push(ba.data);a6.push("]]>")}else{if(be==8){if(ba.data.indexOf("[CDATA[")<0){a6.push("<!--");a6.push(ba.data);a6.push("-->")}else{a6.push("<!");a6.push(ba.data);a6.push(">")}}}}}}a1(a3);return a6.join("")}var v=0,aq=1,a=2,T=3;function q(a2){var a1=a2.startContainer;return a1.nodeType==9?a1:a1.ownerDocument}function E(a1){if(s.browser.msie){return new aw(a1.document)}return a1.getSelection()}function al(a2){var a1=q(a2);return aZ(a1)}function aZ(a1){return E(az(a1))}function az(a1){return a1.defaultView||a1.parentWindow}function am(a1,a2,a4){function a3(a7){var a5=a1.cloneRange();a5.collapse(a7);a5[a7?"setStartBefore":"setEndAfter"](a2);var a6=a5.extractContents();if(a4){a6=D.trim(a6)}D[a7?"insertBefore":"insertAfter"](a6,a2)}a3(true);a3(false)}function O(a2){var a3=U.image(a2);if(a3){a2.setStartAfter(a3);a2.setEndAfter(a3)}var a1=al(a2);a1.removeAllRanges();a1.addRange(a2)}function L(a1){s.extend(this,{ownerDocument:a1,startContainer:a1,endContainer:a1,commonAncestorContainer:a1,startOffset:0,endOffset:0,collapsed:true})}L.prototype={setStart:function(a1,a2){this.startContainer=a1;this.startOffset=a2;w(this);u(this,true)},setEnd:function(a1,a2){this.endContainer=a1;this.endOffset=a2;w(this);u(this,false)},setStartBefore:function(a1){this.setStart(a1.parentNode,p(a1))},setStartAfter:function(a1){this.setStart(a1.parentNode,p(a1)+1)},setEndBefore:function(a1){this.setEnd(a1.parentNode,p(a1))},setEndAfter:function(a1){this.setEnd(a1.parentNode,p(a1)+1)},selectNode:function(a1){this.setStartBefore(a1);this.setEndAfter(a1)},selectNodeContents:function(a1){this.setStart(a1,0);this.setEnd(a1,a1[a1.nodeType===1?"childNodes":"nodeValue"].length)},collapse:function(a1){if(a1){this.setEnd(this.startContainer,this.startOffset)}else{this.setStart(this.endContainer,this.endOffset)}},deleteContents:function(){var a2=this.cloneRange();if(this.startContainer!=this.commonAncestorContainer){this.setStartAfter(aB(this.commonAncestorContainer,this.startContainer))}this.collapse(true);(function a1(a3){while(a3.next()){a3.hasPartialSubtree()?a1(a3.getSubtreeIterator()):a3.remove()}})(new l(a2))},cloneContents:function(){var a1=q(this);return(function a2(a5){for(var a4,a3=a1.createDocumentFragment();a4=a5.next();){a4=a4.cloneNode(!a5.hasPartialSubtree());if(a5.hasPartialSubtree()){a4.appendChild(a2(a5.getSubtreeIterator()))}a3.appendChild(a4)}return a3})(new l(this))},extractContents:function(){var a2=this.cloneRange();if(this.startContainer!=this.commonAncestorContainer){this.setStartAfter(aB(this.commonAncestorContainer,this.startContainer))}this.collapse(true);var a3=this;var a1=q(this);return(function a4(a7){for(var a6,a5=a1.createDocumentFragment();a6=a7.next();){a7.hasPartialSubtree()?a6=a6.cloneNode(false):a7.remove(a3.originalRange);if(a7.hasPartialSubtree()){a6.appendChild(a4(a7.getSubtreeIterator()))}a5.appendChild(a6)}return a5})(new l(a2))},insertNode:function(a1){if(af(this.startContainer)){if(this.startOffset!=this.startContainer.nodeValue.length){av(this.startContainer,this.startOffset)}D.insertAfter(a1,this.startContainer)}else{D.insertAt(this.startContainer,a1,this.startOffset)}this.setStart(this.startContainer,this.startOffset)},cloneRange:function(){return s.extend(new L(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var a2=this.startContainer.nodeName,a1=this.endContainer.nodeName;return[a2=="#text"?this.startContainer.nodeValue:a2,"(",this.startOffset,") : ",a1=="#text"?this.endContainer.nodeValue:a1,"(",this.endOffset,")"].join("")}};function m(a3,a1,a8,a5){if(a3==a1){return a5-a8}var a7=a1;while(a7&&a7.parentNode!=a3){a7=a7.parentNode}if(a7){return p(a7)-a8}a7=a3;while(a7&&a7.parentNode!=a1){a7=a7.parentNode}if(a7){return a5-p(a7)-1}var a6=D.commonAncestor(a3,a1);var a4=a3;while(a4&&a4.parentNode!=a6){a4=a4.parentNode}if(!a4){a4=a6}var a2=a1;while(a2&&a2.parentNode!=a6){a2=a2.parentNode}if(!a2){a2=a6}if(a4==a2){return 0}return p(a2)-p(a4)}function u(a2,a3){function a1(a5){try{return m(a5.startContainer,a5.endContainer,a5.startOffset,a5.endOffset)<0}catch(a4){return true}}if(a1(a2)){if(a3){a2.commonAncestorContainer=a2.endContainer=a2.startContainer;a2.endOffset=a2.startOffset}else{a2.commonAncestorContainer=a2.startContainer=a2.endContainer;a2.startOffset=a2.endOffset}a2.collapsed=true}}function w(a2){a2.collapsed=a2.startContainer==a2.endContainer&&a2.startOffset==a2.endOffset;var a1=a2.startContainer;while(a1&&a1!=a2.endContainer&&!k(a1,a2.endContainer)){a1=a1.parentNode}a2.commonAncestorContainer=a1}function aQ(a1){if(s.browser.msie){return new L(a1)}return a1.createRange()}function l(a2){s.extend(this,{range:a2,_current:null,_next:null,_end:null});if(a2.collapsed){return}var a1=a2.commonAncestorContainer;this._next=a2.startContainer==a1&&!af(a2.startContainer)?a2.startContainer.childNodes[a2.startOffset]:aB(a1,a2.startContainer);this._end=a2.endContainer==a1&&!af(a2.endContainer)?a2.endContainer.childNodes[a2.endOffset]:aB(a1,a2.endContainer).nextSibling}l.prototype={hasNext:function(){return !!this._next},next:function(){var a1=this._current=this._next;this._next=this._current&&this._current.nextSibling!=this._end?this._current.nextSibling:null;if(af(this._current)){if(this.range.endContainer==this._current){(a1=a1.cloneNode(true)).deleteData(this.range.endOffset,a1.length-this.range.endOffset)}if(this.range.startContainer==this._current){(a1=a1.cloneNode(true)).deleteData(0,this.range.startOffset)}}return a1},traverse:function(a2){function a1(){this._current=this._next;this._next=this._current&&this._current.nextSibling!=this._end?this._current.nextSibling:null;return this._current}var a3;while(a3=a1.call(this)){if(this.hasPartialSubtree()){this.getSubtreeIterator().traverse(a2)}else{a2(a3)}}return a3},remove:function(a6){var a5=this.range.startContainer==this._current;var a3=this.range.endContainer==this._current;if(af(this._current)&&(a5||a3)){var a2=a5?this.range.startOffset:0;var a1=a3?this.range.endOffset:this._current.length;var a8=a1-a2;if(a6&&(a5||a3)){if(this._current==a6.startContainer&&a2<=a6.startOffset){a6.startOffset-=a8}if(this._current==a6.endContainer&&a1<=a6.endOffset){a6.endOffset-=a8}}this._current.deleteData(a2,a8)}else{var a7=this._current.parentNode;if(a6&&(this.range.startContainer==a7||this.range.endContainer==a7)){var a4=p(this._current);if(a7==a6.startContainer&&a4<=a6.startOffset){a6.startOffset-=1}if(a7==a6.endContainer&&a4<a6.endOffset){a6.endOffset-=1}}D.remove(this._current)}},hasPartialSubtree:function(){return !af(this._current)&&(z(this._current,this.range.startContainer)||z(this._current,this.range.endContainer))},getSubtreeIterator:function(){var a1=this.range.cloneRange();a1.selectNodeContents(this._current);if(z(this._current,this.range.startContainer)){a1.setStart(this.range.startContainer,this.range.startOffset)}if(z(this._current,this.range.endContainer)){a1.setEnd(this.range.endContainer,this.range.endOffset)}return new l(a1)}};function aw(a1){this.ownerDocument=a1;this.rangeCount=1}aw.prototype={addRange:function(a2){var a1=this.ownerDocument.body.createTextRange();h(a1,a2,false);h(a1,a2,true);a1.select()},removeAllRanges:function(){this.ownerDocument.selection.empty()},getRangeAt:function(){var a4,a3=new L(this.ownerDocument),a2=this.ownerDocument.selection,a1;try{a4=a2.createRange();a1=a4.item?a4.item(0):a4.parentElement();if(a1.ownerDocument!=this.ownerDocument){return a3}}catch(a5){return a3}if(a2.type=="Control"){a3.selectNode(a4.item(0))}else{aL(a4,a3,true);aL(a4,a3,false);if(a3.startContainer.nodeType==9){a3.setStart(a3.endContainer,a3.startOffset)}if(a3.endContainer.nodeType==9){a3.setEnd(a3.startContainer,a3.endOffset)}if(a4.compareEndPoints("StartToEnd",a4)==0){a3.collapse(false)}}return a3}};function h(a8,a2,a1){var a5=a2[a1?"startContainer":"endContainer"];var a6=a2[a1?"startOffset":"endOffset"],ba=0;var a3=af(a5)?a5:a5.childNodes[a6]||null;var a7=af(a5)?a5.parentNode:a5;if(a5.nodeType==3||a5.nodeType==4){ba=a6}var a9=a7.insertBefore(D.create(a2.ownerDocument,"a"),a3);var a4=a2.ownerDocument.body.createTextRange();a4.moveToElementText(a9);D.remove(a9);a4[a1?"moveStart":"moveEnd"]("character",ba);a4.collapse(false);a8.setEndPoint(a1?"StartToStart":"EndToStart",a4)}function aL(a6,a2,a1){var a4=D.create(a2.ownerDocument,"a"),a7=a6.duplicate();a7.collapse(a1);var a3=a7.parentElement();do{a3.insertBefore(a4,a4.previousSibling);a7.moveToElementText(a4)}while(a7.compareEndPoints(a1?"StartToStart":"StartToEnd",a6)>0&&a4.previousSibling);a7.setEndPoint(a1?"EndToStart":"EndToEnd",a6);var a5=a4.nextSibling;if(!a5){a5=a4.previousSibling;if(a5&&af(a5)){a2.setEnd(a5,a5.nodeValue.length);D.remove(a4)}else{a2.selectNodeContents(a3);D.remove(a4);a2.endOffset-=1}return}D.remove(a4);if(af(a5)){a2[a1?"setStart":"setEnd"](a5,a7.text.length)}else{a2[a1?"setStartBefore":"setEndBefore"](a5)}}function aj(a1){this.enumerate=function(){var a3=[];function a2(a4){if(D.is(a4,"img")||(a4.nodeType==3&&!D.isWhitespace(a4))){a3.push(a4)}else{a4=a4.firstChild;while(a4){a2(a4);a4=a4.nextSibling}}}new l(a1).traverse(a2);return a3}}function j(a1){return new aj(a1).enumerate()}function Z(a5){var a1=[];for(var a2=0,a4=a5.length;a2<a4;a2++){var a3=D.parentOfType(a5[a2],H);if(a3&&s.inArray(a3,a1)<0){a1.push(a3)}}return a1}function aF(a2){var a1=[];new l(a2).traverse(function(a3){if(a3.className=="t-marker"){a1.push(a3)}});return a1}function an(a3){var a6=q(a3);this.body=a6.body;this.html=this.body.innerHTML;function a5(ba){var a8=0,a7=ba.nodeType;while(ba=ba.previousSibling){var a9=ba.nodeType;if(a9!=3||a7!=a9){a8++}a7=a9}return a8}function a4(a7,a8){if(a7.nodeType==3){while((a7=a7.previousSibling)&&a7.nodeType==3){a8+=a7.nodeValue.length}}return a8}function a2(a7){var a8=[];while(a7!=a6){a8.push(a5(a7));a7=a7.parentNode}return a8}function a1(a9,a8,a7,ba){var bd=a6,bc=a7.length,bb=ba;while(bc--){bd=bd.childNodes[a7[bc]]}while(bd.nodeType==3&&bd.nodeValue.length<bb){bb-=bd.nodeValue.length;bd=bd.nextSibling}a9[a8?"setStart":"setEnd"](bd,bb)}this.startContainer=a2(a3.startContainer);this.endContainer=a2(a3.endContainer);this.startOffset=a4(a3.startContainer,a3.startOffset);this.endOffset=a4(a3.endContainer,a3.endOffset);this.toRange=function(){var a7=a3.cloneRange();a1(a7,true,this.startContainer,this.startOffset);a1(a7,false,this.endContainer,this.endOffset);return a7}}function ac(){var a1;this.addCaret=function(a2){a1=D.create(q(a2),"span",{className:"t-marker"});a2.insertNode(a1);a2.selectNode(a1);return a1};this.removeCaret=function(a3){var a5=a1.previousSibling;var a8=0;if(a5){a8=af(a5)?a5.nodeValue.length:p(a5)}var a7=a1.parentNode;var a6=a5?p(a5):0;D.remove(a1);g(a7);var a2=a7.childNodes[a6];if(af(a2)){a3.setStart(a2,a8)}else{if(a2){var a4=D.lastTextNode(a2);if(a4){a3.setStart(a4,a4.nodeValue.length)}else{a3[a5?"setStartAfter":"setStartBefore"](a2)}}else{if(!s.browser.msie&&a7.innerHTML==""){a7.innerHTML='<br _moz_dirty="" />'}a3.selectNodeContents(a7)}}a3.collapse(true)};this.add=function(a2,a4){if(a4&&a2.collapsed){this.addCaret(a2);a2=U.expand(a2)}var a3=a2.cloneRange();a3.collapse(false);this.end=D.create(q(a2),"span",{className:"t-marker"});a3.insertNode(this.end);a3=a2.cloneRange();a3.collapse(true);this.start=this.end.cloneNode(true);a3.insertNode(this.start);a2.setStartBefore(this.start);a2.setEndAfter(this.end);g(a2.commonAncestorContainer);return a2};this.remove=function(a9){var a2=this.start,be=this.end;g(a9.commonAncestorContainer);while(!a2.nextSibling&&a2.parentNode){a2=a2.parentNode}while(!be.previousSibling&&be.parentNode){be=be.parentNode}var a4=(a2.previousSibling&&a2.previousSibling.nodeType==3)&&(a2.nextSibling&&a2.nextSibling.nodeType==3);var ba=(be.previousSibling&&be.previousSibling.nodeType==3)&&(be.nextSibling&&be.nextSibling.nodeType==3);a2=a2.nextSibling;be=be.previousSibling;var bd=false;var a7=false;if(a2==this.end){a7=!!this.start.previousSibling;a2=be=this.start.previousSibling||this.end.nextSibling;bd=true}D.remove(this.start);D.remove(this.end);if(a2==null||be==null){a9.selectNodeContents(a9.commonAncestorContainer);a9.collapse(true);return}var bc=bd?af(a2)?a2.nodeValue.length:a2.childNodes.length:0;var a5=af(be)?be.nodeValue.length:be.childNodes.length;if(a2.nodeType==3){while(a2.previousSibling&&a2.previousSibling.nodeType==3){a2=a2.previousSibling;bc+=a2.nodeValue.length}}if(be.nodeType==3){while(be.previousSibling&&be.previousSibling.nodeType==3){be=be.previousSibling;a5+=be.nodeValue.length}}var a8=p(a2),bb=a2.parentNode;var a6=p(be),a3=be.parentNode;for(var bg=a2;bg.previousSibling;bg=bg.previousSibling){if(bg.nodeType==3&&bg.previousSibling.nodeType==3){a8--}}for(var bf=be;bf.previousSibling;bf=bf.previousSibling){if(bf.nodeType==3&&bf.previousSibling.nodeType==3){a6--}}g(bb);if(a2.nodeType==3){a2=bb.childNodes[a8]}g(a3);if(be.nodeType==3){be=a3.childNodes[a6]}if(bd){if(a2.nodeType==3){a9.setStart(a2,bc)}else{a9[a7?"setStartAfter":"setStartBefore"](a2)}a9.collapse(true)}else{if(a2.nodeType==3){a9.setStart(a2,bc)}else{a9.setStartBefore(a2)}if(be.nodeType==3){a9.setEnd(be,a5)}else{a9.setEndAfter(be)}}if(a1){this.removeCaret(a9)}}}var at=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/;var U={nodes:function(a2){var a1=j(a2);if(!a1.length){a2.selectNodeContents(a2.commonAncestorContainer);a1=j(a2);if(!a1.length){a1=D.significantChildNodes(a2.commonAncestorContainer)}}return a1},image:function(a2){var a1=[];new l(a2).traverse(function(a3){if(D.is(a3,"img")){a1.push(a3)}});if(a1.length==1){return a1[0]}},expand:function(a2){var a3=a2.cloneRange();var a6=a3.startContainer.childNodes[a3.startOffset==0?0:a3.startOffset-1];var a7=a3.endContainer.childNodes[a3.endOffset];if(!af(a6)||!af(a7)){return a3}var a4=a6.nodeValue;var a5=a7.nodeValue;if(a4==""||a5==""){return a3}var a1=a4.split("").reverse().join("").search(at);var a8=a5.search(at);if(a1==0||a8==0){return a3}a8=a8==-1?a5.length:a8;a1=a1==-1?0:a4.length-a1;a3.setStart(a6,a1);a3.setEnd(a7,a8);return a3},isExpandable:function(a2){var a7=a2.startContainer;var a6=q(a2);if(a7==a6||a7==a6.body){return false}var a3=a2.cloneRange();var a1=a7.nodeValue;if(!a1){return false}var a4=a1.substring(0,a3.startOffset);var a5=a1.substring(a3.startOffset);var a8=0,a9=0;if(a4!=""){a8=a4.split("").reverse().join("").search(at)}if(a5!=""){a9=a5.search(at)}return a8!=0&&a9!=0}};function c(a2){var a3=new an(a2.range);var a1=new ac();this.formatter=a2.formatter;this.getRange=function(){return a3.toRange()};this.lockRange=function(a4){return a1.add(this.getRange(),a4)};this.releaseRange=function(a4){a1.remove(a4);O(a4)};this.undo=function(){a3.body.innerHTML=a3.html;O(a3.toRange())};this.redo=function(){this.exec()};this.exec=function(){var a4=this.lockRange(true);this.formatter.editor=this.editor;this.formatter.toggle(a4);this.releaseRange(a4)}}function aW(a3,a2){var a1=a3.body;this.redo=function(){a1.innerHTML=a2.html;O(a2.toRange())};this.undo=function(){a1.innerHTML=a3.html;O(a3.toRange())}}function t(a1){c.call(this,a1);this.managesUndoRedo=true;this.exec=function(){var a3=this.editor;var a2=a3.getRange();var a4=new an(a2);a3.clipboard.paste(a1.value||"");a3.undoRedoStack.push(new aW(a4,new an(a3.getRange())));a3.focus()}}function x(){X.call(this);this.command=function(a1){return new t(a1)};this.update=function(a1,a2){a1.data("tSelectBox").close()};this.init=function(a3,a1){var a2=a1.editor;a3.tSelectBox({data:a2.insertHtml,onItemCreate:function(a4){a4.html='<span unselectable="on">'+a4.dataItem.Text+"</span>"},onChange:function(a4){X.exec(a2,"insertHtml",a4.value)},highlightFirst:false}).find(".t-input").html(a2.localization.insertHtml)}}function R(){var a2=[],a1=-1;this.push=function(a3){a2=a2.slice(0,a1+1);a1=a2.push(a3)-1};this.undo=function(){if(this.canUndo()){a2[a1--].undo()}};this.redo=function(){if(this.canRedo()){a2[++a1].redo()}};this.canUndo=function(){return a1>=0};this.canRedo=function(){return a1!=a2.length-1}}function aR(a1){this.keydown=function(a5){var a4=a1.keyboard;var a2=a4.isTypingKey(a5);if(a2&&!a4.typingInProgress()){var a3=a1.getRange();this.startRestorePoint=new an(a3);a4.startTyping(s.proxy(function(){a1.selectionRestorePoint=this.endRestorePoint=new an(a1.getRange());a1.undoRedoStack.push(new aW(this.startRestorePoint,this.endRestorePoint))},this));return true}return false};this.keyup=function(a2){var a3=a1.keyboard;if(a3.typingInProgress()){a3.endTyping();return true}return false}}function A(a2){var a1=false;this.createUndoCommand=function(){this.endRestorePoint=new an(a2.getRange());a2.undoRedoStack.push(new aW(this.startRestorePoint,this.endRestorePoint));this.startRestorePoint=this.endRestorePoint};this.changed=function(){if(this.startRestorePoint){return this.startRestorePoint.html!=a2.body.innerHTML}return false};this.keydown=function(a3){var a4=a2.keyboard;if(a4.isModifierKey(a3)){if(a4.typingInProgress()){a4.endTyping(true)}this.startRestorePoint=new an(a2.getRange());return true}if(a4.isSystem(a3)){a1=true;if(this.changed()){a1=false;this.createUndoCommand()}return true}return false};this.keyup=function(a3){if(a1&&this.changed()){a1=false;this.createUndoCommand(a3);return true}return false}}function aH(a2){var a4=false;var a7;var a3;function a1(a8){return(a8>=48&&a8<=90)||(a8>=96&&a8<=111)||(a8>=186&&a8<=192)||(a8>=219&&a8<=222)}this.toolFromShortcut=function(ba,bc){var a9=String.fromCharCode(bc.keyCode);for(var bb in ba){var a8=ba[bb];if((a8.key==a9||a8.key==bc.keyCode)&&!!a8.ctrl==bc.ctrlKey&&!!a8.alt==bc.altKey&&!!a8.shift==bc.shiftKey){return bb}}};this.isTypingKey=function(a9){var a8=a9.keyCode;return(a1(a8)&&!a9.ctrlKey&&!a9.altKey)||a8==32||a8==13||a8==8||(a8==46&&!a9.shiftKey&&!a9.ctrlKey&&!a9.altKey)};this.isModifierKey=function(a9){var a8=a9.keyCode;return(a8==17&&!a9.shiftKey&&!a9.altKey)||(a8==16&&!a9.ctrlKey&&!a9.altKey)||(a8==18&&!a9.ctrlKey&&!a9.shiftKey)};this.isSystem=function(a8){return a8.keyCode==46&&a8.ctrlKey&&!a8.altKey&&!a8.shiftKey};this.startTyping=function(a8){a3=a8;a4=true};function a5(){a4=false;a3()}this.endTyping=function(a8){this.clearTimeout();if(a8){a5()}else{a7=window.setTimeout(a5,1000)}};this.typingInProgress=function(){return a4};this.clearTimeout=function(){window.clearTimeout(a7)};function a6(ba,a9){for(var a8=0;a8<a2.length;a8++){if(a2[a8][a9](ba)){break}}}this.keydown=function(a8){a6(a8,"keydown")};this.keyup=function(a8){a6(a8,"keyup")}}function aA(a5){var a4=[new f()];function a2(a7){var a8=D.create(a5.document,"div");a8.innerHTML=a7;var a6=a5.document.createDocumentFragment();while(a8.firstChild){a6.appendChild(a8.firstChild)}return a6}function a1(a6){return/<(div|p|ul|ol|table|h[1-6])/i.test(a6)}this.oncut=function(a6){var a7=new an(a5.getRange());setTimeout(function(){a5.undoRedoStack.push(new aW(a7,new an(a5.getRange())))})};this.onpaste=function(ba){var a6=a5.getRange();var a8=new an(a6);var bc=D.create(a5.document,"div",{className:"t-paste-container",innerHTML:"\ufeff"});a5.body.appendChild(bc);if(a5.body.createTextRange){ba.preventDefault();var a9=a5.createRange();a9.selectNodeContents(bc);a5.selectRange(a9);var bb=a5.body.createTextRange();bb.moveToElementText(bc);s(a5.body).unbind("paste");bb.execCommand("Paste");s(a5.body).bind("paste",arguments.callee)}else{var a7=a5.createRange();a7.selectNodeContents(bc);O(a7)}setTimeout(function(){O(a6);D.remove(bc);if(bc.lastChild&&D.is(bc.lastChild,"br")){D.remove(bc.lastChild)}a5.clipboard.paste(bc.innerHTML);a5.undoRedoStack.push(new aW(a8,new an(a5.getRange())))})};function a3(a7,a9){if(a7){return D.parentOfType(a9,["p","ul","ol"])||a9.parentNode}var a6=a9.parentNode;var a8=a9.ownerDocument.body;if(D.isInline(a6)){while(a6.parentNode!=a8&&!D.isBlock(a6.parentNode)){a6=a6.parentNode}}return a6}this.paste=function(ba){var a6,a8;for(a6=0,a8=a4.length;a6<a8;a6++){if(a4[a6].applicable(ba)){ba=a4[a6].clean(ba)}}ba=ba.replace(/^<li/i,"<ul><li").replace(/li>$/g,"li></ul>");var a7=a1(ba);var a9=a5.getRange();a9.deleteContents();if(a9.startContainer==a5.document){a9.selectNodeContents(a5.body)}var bc=new ac();var bf=bc.addCaret(a9);var be=a3(a7,bf);var bd=false;if(!/body|td/.test(D.name(be))&&(a7||D.isInline(be))){a9.selectNode(bf);am(a9,be,true);bd=true}var bg=a2(ba);if(bg.firstChild&&bg.firstChild.className==="t-paste-container"){var bb=[];for(a6=0,a8=bg.childNodes.length;a6<a8;a6++){bb.push(bg.childNodes[a6].innerHTML)}bg=a2(bb.join("<br />"))}a9.insertNode(bg);be=a3(a7,bf);if(bd){while(bf.parentNode!=be){D.unwrap(bf.parentNode)}D.unwrap(bf.parentNode)}g(a9.commonAncestorContainer);bf.style.display="inline";D.scrollTo(bf);bc.removeCaret(a9);O(a9)}}function f(){var a1=[/<!--(.|\n)*?-->/g,"",/mso-[^;"]*;?/ig,"",/<\/?(meta|link|style|o:|v:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:)[^>]*>)?/ig,""];this.applicable=function(a4){return/class="?Mso|style="[^"]*mso-/i.test(a4)};function a2(a4){if(/^[\u2022\u00b7\u00a7\u00d8o\-]\u00a0+/.test(a4)){return"ul"}if(/^\s*\w+[\.\)]\u00a0{2,}/.test(a4)){return"ol"}}function a3(bh){var a9=D.create(document,"div",{innerHTML:bh});var bg=s(H.join(","),a9);var bb=-1,a6,bf={ul:{},ol:{}},a4=a9;for(var bc=0;bc<bg.length;bc++){var a7=bg[bc];var bh=a7.innerHTML.replace(/<\/?\w+[^>]*>/g,"").replace(/&nbsp;/g,"\u00a0");var ba=a2(bh);if(!ba||D.name(a7)!="p"){if(a7.innerHTML==""){D.remove(a7)}else{bf={ul:{},ol:{}};a4=a9;bb=-1}continue}var bd=parseFloat(a7.style.marginLeft||0);var be=bf[ba][bd];if(bd>bb||!be){be=D.create(document,ba);if(a4==a9){D.insertBefore(be,a7)}else{a4.appendChild(be)}bf[ba][bd]=be}if(a6!=ba){for(var a8 in bf){for(var a5 in bf[a8]){if(s.contains(be,bf[a8][a5])){delete bf[a8][a5]}}}}D.remove(a7.firstChild);a4=D.create(document,"li",{innerHTML:a7.innerHTML});be.appendChild(a4);D.remove(a7);bb=bd;a6=ba}return a9.innerHTML}this.clean=function(a5){for(var a4=0,a6=a1.length;a4<a6;a4+=2){a5=a5.replace(a1[a4],a1[a4+1])}a5=a3(a5);a5=a5.replace(/\s+class="?[^"\s>]*"?/ig,"");return a5}}function i(a1){function a2(a5){var a3=0;for(var a4=a5.parentNode.firstChild;a4;a4=a4.nextSibling){if(a4!=a5&&a4.className!="t-marker"&&a4.nodeType==1){a3++}}return a3}this.findSuitable=function(a4,a3){if(!a3&&a2(a4)>0){return null}return D.parentOfType(a4,a1[0].tags)};this.findFormat=function(a7){for(var a3=0;a3<a1.length;a3++){var a5=a7;var a4=a1[a3].tags;var a6=a1[a3].attr;if(a5&&D.ofType(a5,a4)&&B(a5,a6)){return a5}while(a5){a5=D.parentOfType(a5,a4);if(a5&&B(a5,a6)){return a5}}}return null};this.isFormatted=function(a3){for(var a4=0;a4<a3.length;a4++){if(this.findFormat(a3[a4])){return true}}return false}}function b(a3,a5){this.finder=new i(a3);var a4=s.extend({},a3[0].attr,a5);var a1=a3[0].tags[0];function a2(a6){return D.wrap(a6,D.create(a6.ownerDocument,a1,a4))}this.activate=function(a7,a6){if(this.finder.isFormatted(a6)){this.split(a7);this.remove(a6)}else{this.apply(a6)}};this.toggle=function(a7){var a6=j(a7);if(a6.length>0){this.activate(a7,a6)}};this.apply=function(a9){var a8=[];for(var a6=0,a7=a9.length;a6<a7;a6++){var bb=a9[a6];var ba=this.finder.findSuitable(bb);if(ba){D.attr(ba,a4)}else{ba=a2(bb)}a8.push(ba)}this.consolidate(a8)};this.remove=function(a9){for(var a6=0,a8=a9.length;a6<a8;a6++){var a7=this.finder.findFormat(a9[a6]);if(a7){D.unwrap(a7)}}};this.split=function(a8){var ba=j(a8);if(ba.length>0){for(var a6=0,a9=ba.length;a6<a9;a6++){var a7=this.finder.findFormat(ba[a6]);if(a7){am(a8,a7,true)}}}};this.consolidate=function(a8){while(a8.length>1){var a6=a8.pop();var a7=a8[a8.length-1];if(a6.previousSibling&&a6.previousSibling.className=="t-marker"){a7.appendChild(a6.previousSibling)}if(a6.previousSibling==a7&&a6.style.cssText==a7.style.cssText){while(a6.firstChild){a7.appendChild(a6.firstChild)}D.remove(a6)}}}}function a0(a2,a1){i.call(this,a2);function a3(a7){var bi=a7.attributes,bf=s.trim;if(!bi){return}for(var a6=0,bd=bi.length;a6<bd;a6++){var bc=bi[a6],a8=bc.nodeName,be=bc.nodeValue;if(bc.specified&&a8=="style"){var a9=bf(be||a7.style.cssText).split(";");for(var bg=0,ba=a9.length;bg<ba;bg++){var bj=a9[bg];if(bj.length){var bb=bj.split(":");var bh=bf(bb[0].toLowerCase()),a5=bf(bb[1]);if(bh!=a1){continue}return bh.indexOf("color")>=0?D.toHex(a5):a5}}}}return}function a4(a9){var ba=s(af(a9)?a9.parentNode:a9);var a8=ba.parents().andSelf();for(var a6=0,a7=a8.length;a6<a7;a6++){var a5=a1=="className"?a8[a6].className:a3(a8[a6]);if(a5){return a5}}return"inherit"}this.getFormat=function(a8){var a5=a4(a8[0]);for(var a7=1,a6=a8.length;a7<a6;a7++){if(a5!=a4(a8[a7])){return""}}return a5};this.isFormatted=function(a5){return this.getFormat(a5)!==""}}function F(a2,a3,a1){b.call(this,a2,a3);this.finder=new a0(a2,a1);this.activate=function(a5,a6){this.split(a5);if(a1){var a4=a1.replace(/-([a-z])/,function(a7,a8){return a8.toUpperCase()});this[a3.style[a4]=="inherit"?"remove":"apply"](a6)}else{this.apply(a6)}}}function ad(a1){return a1.collapsed&&!U.isExpandable(a1)}function Y(a1){ai.call(this,s.extend(a1,{finder:new i(a1.format),formatter:function(){return new b(a1.format)}}));this.willDelayExecution=ad}function aC(a4){X.call(this,a4);var a3=s.browser.msie?"tSelectBox":"tComboBox",a2=[{tags:["span"]}],a1=new a0(a2,a4.cssAttr);this.command=function(a5){return new aJ(s.extend(a5,{formatter:function(){var a6={};a6[a4.domAttr]=a5.value;return new F(a2,{style:a6},a4.cssAttr)}}))};this.willDelayExecution=ad;this.update=function(a5,a8,a7){var a9=a5.data(a3);a9.close();var ba=a7.getPending(this.name);var a6=(ba&&ba.params)?ba.params.value:a1.getFormat(a8);a9.value(a6)};this.init=function(a8,a6){var a7=a6.editor;a8[a3]({data:a7[a4.name],onChange:function(a9){X.exec(a7,a4.name,a9.value)},highlightFirst:false});var a5=a8.data(a3);a5.value("inherit");a5.dropDown.onItemCreate=function(a9){a9.html='<span unselectable="on" style="'+a4.cssAttr+": "+a9.dataItem.Value+'">'+a9.dataItem.Text+"</span>"}}}function aY(a3){X.call(this,a3);var a2=[{tags:["span"]}],a1=new a0(a2,a3.cssAttr);this.update=function(a4){a4.data("tColorPicker").close()};this.command=function(a4){return new aJ(s.extend(a4,{formatter:function(){var a5={};a5[a3.domAttr]=a4.value;return new F(a2,{style:a5},a3.cssAttr)}}))};this.willDelayExecution=ad;this.init=function(a6,a4){var a5=a4.editor;a6.tColorPicker({selectedColor:"#000000",onChange:function(a7){X.exec(a5,a3.name,a7.value)}})}}function ab(){X.call(this);var a2=[{tags:["span"]}],a1=new a0(a2,"className");this.command=function(a3){return new aJ(s.extend(a3,{formatter:function(){return new F(a2,{className:a3.value})}}))};this.update=function(a3,a5){var a4=a3.data("tSelectBox");a4.close();a4.value(a1.getFormat(a5))};this.init=function(a5,a3){var a4=a3.editor;a5.tSelectBox({data:a4.style,title:a4.localization.style,onItemCreate:function(a6){var a7=D.inlineStyle(a4.document,"span",{className:a6.dataItem.Value});a6.html='<span unselectable="on" style="display:block;'+a7+'">'+a6.html+"</span>"},onChange:function(a6){X.exec(a4,"style",a6.value)}})}}function y(a2){function a1(a5,a6){for(var a3=0;a3<a6.length;a3++){var a4=a6[a3];if(a4==null||!z(a5,a4)){return false}}return true}this.findSuitable=function(a6){var a5=[];for(var a3=0;a3<a6.length;a3++){var a4=D.ofType(a6[a3],a2[0].tags)?a6[a3]:D.parentOfType(a6[a3],a2[0].tags);if(!a4){return[]}if(s.inArray(a4,a5)<0){a5.push(a4)}}for(var a3=0;a3<a5.length;a3++){if(a1(a5[a3],a5)){return[a5[a3]]}}return a5};this.findFormat=function(a7){for(var a3=0;a3<a2.length;a3++){var a5=a7;var a4=a2[a3].tags;var a6=a2[a3].attr;while(a5){if(D.ofType(a5,a4)&&B(a5,a6)){return a5}a5=a5.parentNode}}return null};this.getFormat=function(a7){var a5=s.proxy(function(a8){return this.findFormat(af(a8)?a8.parentNode:a8)},this),a3=a5(a7[0]);if(!a3){return""}for(var a6=1,a4=a7.length;a6<a4;a6++){if(a3!=a5(a7[a6])){return""}}return a3.nodeName.toLowerCase()};this.isFormatted=function(a3){for(var a4=0;a4<a3.length;a4++){if(!this.findFormat(a3[a4])){return false}}return true}}function W(a2,a4){var a3=new y(a2);function a1(a8,bc,ba){var a9=ba.length==1?D.blockParentOrBody(ba[0]):D.commonAncestor.apply(null,ba);if(D.isInline(a9)){a9=D.blockParentOrBody(a9)}var bb=D.significantChildNodes(a9);var a7=p(bb[0]);var bd=D.create(a9.ownerDocument,a8,bc);for(var a5=0;a5<bb.length;a5++){var a6=bb[a5];if(D.isBlock(a6)){D.attr(a6,bc);if(bd.childNodes.length){D.insertBefore(bd,a6);bd=bd.cloneNode(false)}a7=p(a6)+1;continue}bd.appendChild(a6)}if(bd.firstChild){D.insertAt(a9,bd,a7)}}this.apply=function(a9){var a7=D.is(a9[0],"img")?[a9[0]]:a3.findSuitable(a9);var a8=a7.length?ae(D.name(a7[0]),a2):a2[0];var a5=a8.tags[0];var ba=s.extend({},a8.attr,a4);if(a7.length){for(var a6=0;a6<a7.length;a6++){D.attr(a7[a6],ba)}}else{a1(a5,ba,a9)}};this.remove=function(a8){for(var a5=0,a7=a8.length;a5<a7;a5++){var a6=a3.findFormat(a8[a5]);if(a6){if(D.ofType(a6,["p","img","li"])){D.unstyle(a6,ae(D.name(a6),a2).attr.style)}else{D.unwrap(a6)}}}};this.toggle=function(a6){var a5=U.nodes(a6);if(a3.isFormatted(a5)){this.remove(a5)}else{this.apply(a5)}}}function au(a1,a3){var a2=new y(a1);this.apply=function(a9){var a5=Z(a9);var ba=a1[0].tags[0];if(a5.length){for(var a4=0,a8=a5.length;a4<a8;a4++){if(D.is(a5[a4],"li")){var bb=a5[a4].parentNode;var a6=new J(bb.nodeName.toLowerCase(),ba);var a7=this.editor.createRange();a7.selectNode(a5[a4]);a6.toggle(a7)}else{D.changeTag(a5[a4],ba)}}}else{new W(a1,a3).apply(a9)}};this.toggle=function(a5){var a4=j(a5);if(!a4.length){a5.selectNodeContents(a5.commonAncestorContainer);a4=j(a5);if(!a4.length){a4=D.significantChildNodes(a5.commonAncestorContainer)}}this.apply(a4)}}function aJ(a1){a1.formatter=a1.formatter();c.call(this,a1)}function P(a1){ai.call(this,s.extend(a1,{finder:new y(a1.format),formatter:function(){return new W(a1.format)}}))}function n(){X.call(this);var a1=new y([{tags:H}]);this.command=function(a2){return new aJ(s.extend(a2,{formatter:function(){return new au([{tags:[a2.value]}],{})}}))};this.update=function(a2,a4){var a3=a2.data("tSelectBox");a3.close();a3.value(a1.getFormat(a4))};this.init=function(a4,a2){var a3=a2.editor;a4.tSelectBox({data:a3.formatBlock,title:a3.localization.formatBlock,onItemCreate:function(a6){var a5=a6.dataItem.Value;a6.html="<"+a5+' unselectable="on" style="margin: .3em 0;'+D.inlineStyle(a3.document,a5)+'">'+a6.dataItem.Text+"</"+a5+">"},onChange:function(a5){X.exec(a3,"formatBlock",a5.value)},highlightFirst:false})}}function aS(a1){c.call(this,a1);this.exec=function(){var a4=this.getRange(),be=q(a4),a7,bc=s.browser.msie?"":'<br _moz_dirty="" />';var a6="p,h1,h2,h3,h4,h5,h6".split(","),bf=D.parentOfType(a4.startContainer,a6),a2=D.parentOfType(a4.endContainer,a6),a3=(bf&&!a2)||(!bf&&a2);a4.deleteContents();var bd=D.create(be,"a");a4.insertNode(bd);g(bd.parentNode);var a5=D.parentOfType(bd,["li"]),bg=D.parentOfType(bd,"h1,h2,h3,h4,h5,h6".split(","));if(a5){var a9=a4.cloneRange();a9.selectNode(a5);if(j(a9).length==0){var bh=D.create(be,"p");if(a5.nextSibling){am(a9,a5.parentNode)}D.insertAfter(bh,a5.parentNode);D.remove(a5.parentNode.childNodes.length==1?a5.parentNode:a5);bh.innerHTML=bc;a7=bh}}else{if(bg&&!bd.nextSibling){var bh=D.create(be,"p");D.insertAfter(bh,bg);bh.innerHTML=bc;D.remove(bd);a7=bh}}if(!a7){if(!(a5||bg)){new W([{tags:["p"]}]).apply([bd])}a4.selectNode(bd);var a8=D.parentOfType(bd,[a5?"li":bg?D.name(bg):"p"]);am(a4,a8,a3);var ba=a8.previousSibling;if(D.is(ba,"li")&&ba.firstChild&&!D.is(ba.firstChild,"br")){ba=ba.firstChild}a7=a8.nextSibling;if(D.is(a7,"li")&&a7.firstChild&&!D.is(a7.firstChild,"br")){a7=a7.firstChild}D.remove(a8);function bb(bi){if(bi.firstChild&&D.is(bi.firstChild,"br")){D.remove(bi.firstChild)}if(af(bi)&&bi.nodeValue==""){bi=bi.parentNode}if(bi&&!D.is(bi,"img")&&bi.innerHTML==""){bi.innerHTML=bc}}bb(ba);bb(a7);g(ba)}g(a7);if(!D.is(a7,"img")){a4.selectNodeContents(a7)}else{a4.setStartBefore(a7)}a4.collapse(true);D.scrollTo(a7);O(a4)}}function d(a1){c.call(this,a1);this.exec=function(){var a3=this.getRange();a3.deleteContents();var a2=D.create(q(a3),"br");a3.insertNode(a2);g(a2.parentNode);if(!s.browser.msie&&(!a2.nextSibling||D.isWhitespace(a2.nextSibling))){var a4=a2.cloneNode(true);a4.setAttribute("_moz_dirty","");D.insertAfter(a4,a2)}a3.setStartAfter(a2);a3.collapse(true);O(a3)}}function ap(a2){var a1=[a2=="ul"?"ol":"ul",a2];y.call(this,[{tags:a1}]);this.isFormatted=function(a6){var a3=[],a4;for(var a5=0;a5<a6.length;a5++){if((a4=this.findFormat(a6[a5]))&&D.name(a4)==a2&&s.inArray(a4,a3)<0){a3.push(a4)}}return a3.length==1};this.findSuitable=function(a3){var a4=D.parentOfType(a3[0],a1);if(a4&&D.name(a4)==a2){return a4}return null}}function J(a3,a4){var a5=new ap(a3);function a1(a9,bc){var a8=D.create(a9.ownerDocument,"li");for(var ba=0;ba<bc.length;ba++){var bb=bc[ba];if(D.is(bb,"li")){a9.appendChild(bb);continue}if(D.is(bb,"td")){while(bb.firstChild){a8.appendChild(bb.firstChild)}a9.appendChild(a8);bb.appendChild(a9);a9=a9.cloneNode(false);a8=a8.cloneNode(false);continue}a8.appendChild(bb);if(D.isBlock(bb)){a9.appendChild(a8);D.unwrap(bb);a8=a8.cloneNode(false)}}if(a8.firstChild){a9.appendChild(a8)}}function a6(a8,ba){for(var a9=0;a9<ba.length;a9++){if(z(a8,ba[a9])){return true}}return false}function a2(a9,a8){return a6(a9,a8)||D.isInline(a9)||a9.nodeType==3}this.split=function(bc){var bd=j(bc);if(bd.length){var ba=D.parentOfType(bd[0],["li"]);var a8=D.parentOfType(bd[bd.length-1],["li"]);bc.setStartBefore(ba);bc.setEndAfter(a8);for(var a9=0,bb=bd.length;a9<bb;a9++){var be=a5.findFormat(bd[a9]);if(be){am(bc,be,true)}}}};this.apply=function(bc){var bb=bc.length==1?D.parentOfType(bc[0],["ul","ol"]):D.commonAncestor.apply(null,bc);if(!bb){bb=D.parentOfType(bc[0],["td"])||bc[0].ownerDocument.body}if(D.isInline(bb)){bb=D.blockParentOrBody(bb)}var be=[];var ba=a5.findSuitable(bc);if(!ba){ba=new ap(a3=="ul"?"ol":"ul").findSuitable(bc)}var a9=D.significantChildNodes(bb);if(/table|tbody/.test(D.name(bb))){a9=s.map(bc,function(bg){return D.parentOfType(bg,["td"])})}for(var a8=0;a8<a9.length;a8++){var bd=a9[a8];var bf=D.name(bd);if(a2(bd,bc)&&(!ba||!z(ba,bd))){if(ba&&(bf=="ul"||bf=="ol")){s.each(bd.childNodes,function(){be.push(this)});D.remove(bd)}else{be.push(bd)}}}if(be.length==a9.length&&bb!=bc[0].ownerDocument.body&&!/table|tbody|tr|td/.test(D.name(bb))){be=[bb]}if(!ba){ba=D.create(bb.ownerDocument,a3);D.insertBefore(ba,be[0])}a1(ba,be);if(!D.is(ba,a3)){D.changeTag(ba,a3)}};function a7(a8){for(var a9=a8.firstChild;a9;a9=a9.nextSibling){var bb=D.create(a8.ownerDocument,a4||"p");while(a9.firstChild){var ba=a9.firstChild;if(D.isBlock(ba)){D.insertBefore(ba,a8)}else{bb.appendChild(ba)}}if(bb.firstChild){D.insertBefore(bb,a8)}}D.remove(a8)}this.remove=function(bb){var a9;for(var a8=0,ba=bb.length;a8<ba;a8++){if(a9=a5.findFormat(bb[a8])){a7(a9)}}};this.toggle=function(a9){var a8=j(a9);if(!a8.length){a9.selectNodeContents(a9.commonAncestorContainer);a8=j(a9);if(!a8.length){a8=D.significantChildNodes(a9.commonAncestorContainer)}}if(a5.isFormatted(a8)){this.split(a9);this.remove(a8)}else{this.apply(a8)}}}function ay(a1){a1.formatter=new J(a1.tag);c.call(this,a1)}function aN(a1){ai.call(this,s.extend(a1,{finder:new ap(a1.tag)}));this.command=function(a2){return new ay(s.extend(a2,{tag:a1.tag}))}}function I(){this.findSuitable=function(a1){return D.parentOfType(a1,["a"])}}function aX(){this.finder=new I();this.apply=function(a1,a7){var a3=j(a1);if(a7.innerHTML!=undefined){var a4=aF(a1);var a2=q(a1);a1.deleteContents();var a5=D.create(a2,"a",a7);a1.insertNode(a5);if(a4.length>1){D.insertAfter(a4[a4.length-1],a5);D.insertAfter(a4[1],a5);D[a3.length>0?"insertBefore":"insertAfter"](a4[0],a5)}}else{var a6=new b([{tags:["a"]}],a7);a6.finder=this.finder;a6.apply(a3)}}}function ao(a1){a1.formatter={toggle:function(a2){new b([{tags:["a"]}]).remove(j(a2))}};c.call(this,a1)}function aa(a2){c.call(this,a2);var a1;this.async=true;var a3=new aX();this.exec=function(){var a8=this.getRange();var a6=a8.collapsed;a8=this.lockRange(true);var bb=j(a8);var ba=null;var a5=this;function bc(bi){var bh=s("#t-editor-link-url",a9.element).val();if(bh&&bh!="http://"){a1={href:bh};var be=s("#t-editor-link-title",a9.element).val();if(be){a1.title=be}var bf=s("#t-editor-link-text",a9.element).val();if(bf!==ba){a1.innerHTML=bf}var bg=s("#t-editor-link-target",a9.element).is(":checked");if(bg){a1.target="_blank"}a3.apply(a8,a1)}a7(bi);if(a5.change){a5.change()}}function a7(be){be.preventDefault();a9.destroy();az(q(a8)).focus();a5.releaseRange(a8)}var bd=bb.length?a3.finder.findSuitable(bb[0]):null;var a4=bb.length<=1||(bb.length==2&&a6);var a9=ar.window.create(s.extend({},this.editor.dialogOptions,{title:"Insert link",html:new s.telerik.stringBuilder().cat('<div class="t-editor-dialog">').cat("<ol>").cat('<li class="t-form-text-row"><label for="t-editor-link-url">Web address</label><input type="text" id="t-editor-link-url"/></li>').catIf('<li class="t-form-text-row"><label for="t-editor-link-text">Text</label><input type="text" id="t-editor-link-text"/></li>',a4).cat('<li class="t-form-text-row"><label for="t-editor-link-title">Tooltip</label><input type="text" id="t-editor-link-title"/></li>').cat('<li class="t-form-checkbox-row"><input type="checkbox" id="t-editor-link-target"/><label for="t-editor-link-target">Open link in new window</label></li>').cat("</ol>").cat('<div class="t-button-wrapper">').cat('<button class="t-dialog-insert t-button">Insert</button>').cat("&nbsp;or&nbsp;").cat('<a href="#" class="t-dialog-close t-link">Close</a>').cat("</div>").cat("</div>").string(),onClose:a7})).hide().find(".t-dialog-insert").click(bc).end().find(".t-dialog-close").click(a7).end().find(".t-form-text-row input").keydown(function(be){if(be.keyCode==13){bc(be)}else{if(be.keyCode==27){a7(be)}}}).end().find("#t-editor-link-url").val(bd?bd.getAttribute("href",2):"http://").end().find("#t-editor-link-text").val(bb.length>0?(bb.length==1?bb[0].nodeValue:bb[0].nodeValue+bb[1].nodeValue):"").end().find("#t-editor-link-title").val(bd?bd.title:"").end().find("#t-editor-link-target").attr("checked",bd?bd.target=="_blank":false).end().show().data("tWindow").center();if(a4&&bb.length>0){ba=s("#t-editor-link-text",a9.element).val()}s("#t-editor-link-url",a9.element).focus().select()},this.redo=function(){var a4=this.lockRange(true);a3.apply(a4,a1);this.releaseRange(a4)}}function aT(a2){X.call(this,s.extend(a2,{command:ao}));var a1=new i([{tags:["a"]}]);this.init=function(a3){a3.attr("unselectable","on").addClass("t-state-disabled")};this.update=function(a3,a4){a3.toggleClass("t-state-disabled",!a1.isFormatted(a4)).removeClass("t-state-hover")}}function aO(a2){c.call(this,a2);this.async=true;var a1;function a3(a4,a5){if(a1.src&&a1.src!="http://"){if(!a4){a4=D.create(q(a5),"img",a1);a4.onload=a4.onerror=function(){a4.removeAttribute("complete");a4.removeAttribute("width");a4.removeAttribute("height")};a5.deleteContents();a5.insertNode(a4);a5.setStartAfter(a4);a5.setEndAfter(a4);O(a5);return true}else{D.attr(a4,a1)}}return false}this.redo=function(){var a4=this.lockRange();if(!a3(U.image(a4),a4)){this.releaseRange(a4)}};this.exec=function(){var a7=this.lockRange();var a4=false;var ba=U.image(a7);var a5=this;function bb(be){a1={src:s("#t-editor-image-url",a8.element).val(),alt:s("#t-editor-image-title",a8.element).val()};a4=a3(ba,a7);a6(be);if(a5.change){a5.change()}}function a6(be){be.preventDefault();a8.destroy();az(q(a7)).focus();if(!a4){a5.releaseRange(a7)}}var a9=this.editor.fileBrowser;var bc=a9&&a9.selectUrl!==undefined;function bd(){if(bc){new ar.imageBrowser(s(this).find(".t-image-browser"),s.extend(a9,{apply:bb,element:a5.editor.element,localization:a5.editor.localization}))}}var a8=ar.window.create(s.extend({width:750},this.editor.dialogOptions,{title:"Insert image",html:new s.telerik.stringBuilder().cat('<div class="t-editor-dialog">').catIf('<div class="t-image-browser"></div>',bc).cat("<ol>").cat('<li class="t-form-text-row"><label for="t-editor-image-url">Web address</label><input type="text" id="t-editor-image-url"/></li>').cat('<li class="t-form-text-row"><label for="t-editor-image-title">Tooltip</label><input type="text" id="t-editor-image-title"/></li>').cat("</ol>").cat('<div class="t-button-wrapper">').cat('<button class="t-dialog-insert t-button">Insert</button>').cat("&nbsp;or&nbsp;").cat('<a href="#" class="t-dialog-close t-link">Close</a>').cat("</div>").cat("</div>").string(),onClose:a6,onActivate:bd})).hide().find(".t-dialog-insert").click(bb).end().find(".t-dialog-close").click(a6).end().find(".t-form-text-row input").keydown(function(be){if(be.keyCode==13){bb(be)}else{if(be.keyCode==27){a6(be)}}}).end().toggleClass("t-imagebrowser",bc).find("#t-editor-image-url").val(ba?ba.getAttribute("src",2):"http://").end().find("#t-editor-image-title").val(ba?ba.alt:"").end().show().data("tWindow").center();s("#t-editor-image-url",a8.element).focus().select()}}ar.selectbox=function(a1,a2){var a9;var a3=s(a1);var a5=a3.find(".t-input");var a6=this.dropDown=new ar.dropDown({effects:ar.fx.slide.defaults(),onItemCreate:a2.onItemCreate,onClick:function(ba){a8(a2.data[s(ba.item).index()].Value);a2.onChange({value:a9})}});function a4(){if(!a6.$items){a6.dataBind(a2.data)}}function a7(ba){a5.html(ba?ba:"&nbsp;")}function a8(bc){a4();var bb=-1;for(var ba=0,bd=a2.data.length;ba<bd;ba++){if(a2.data[ba].Value==bc){bb=ba;break}}if(bb!=-1){a6.$items.removeClass("t-state-selected").eq(bb).addClass("t-state-selected");a7(s(a6.$items[bb]).text());a9=a2.data[bb].Value}}this.value=function(ba){if(ba==undefined){return a9}a8(ba);if(a9!=ba){a7(a2.title||ba)}};this.close=function(){a6.close()};a7(a2.title||a5.text());a3.bind("click",function(ba){a4();if(a6.isOpened()){a6.close()}else{a6.open({offset:a3.offset(),outerHeight:a3.outerHeight(),outerWidth:a3.outerWidth(),zIndex:ar.getElementZIndex(a3[0])})}}).find("*").attr("unselectable","on");a6.$element.css("direction",a3.closest(".t-rtl").length>0?"rtl":"");s(document.documentElement).bind("mousedown",s.proxy(function(bc){var ba=a6.$element;var bb=ba&&ba.parent().length>0;if(bb&&!s.contains(a1,bc.target)&&!s.contains(ba.parent()[0],bc.target)){a6.close()}},this))};s.fn.tSelectBox=function(a1){return ar.create(this,{name:"tSelectBox",init:function(a2,a3){return new ar.selectbox(a2,a3)},options:a1})};s.fn.tSelectBox.defaults={effects:ar.fx.slide.defaults()};ar.colorpicker=function(a1,a2){this.element=a1;var a3=s(a1);s.extend(this,a2);a3.bind("click",s.proxy(this.click,this)).find("*").attr("unselectable","on");if(this.selectedColor){a3.find(".t-selected-color").css("background-color",this.selectedColor)}s(a1.ownerDocument.documentElement).bind("mousedown",s.proxy(function(a4){if(!s(a4.target).closest(".t-colorpicker-popup").length){this.close()}},this));ar.bind(this,{change:this.onChange,load:this.onLoad})};ar.colorpicker.prototype={select:function(a1){if(a1){a1=D.toHex(a1);if(!ar.trigger(this.element,"change",{value:a1})){this.value(a1);this.close()}}else{ar.trigger(this.element,"change",{value:this.selectedColor})}},open:function(){var a1=this.popup();var a4=s(this.element);var a3=a4.offset();a3.top+=a4.outerHeight();if(a4.closest(".t-rtl").length){a3.left-=a1.outerWidth()-a4.outerWidth()}var a2="auto";a4.parents().andSelf().each(function(){a2=s(this).css("zIndex");if(Number(a2)){a2=Number(a2)+1;return false}});ar.fx._wrap(a1).css(s.extend({position:"absolute",zIndex:a2},a3));a1.find(".t-item").bind("click",s.proxy(function(a6){var a5=s(a6.target,a6.target.ownerDocument).css("background-color");this.select(a5)},this));ar.fx.play(this.effects,a1,{direction:"bottom"})},close:function(){if(!this.$popup){return}ar.fx.rewind(this.effects,this.$popup,{direction:"bottom"},s.proxy(function(){D.remove(this.$popup[0].parentNode);this.$popup=null},this))},toggle:function(){if(!this.$popup||!this.$popup.is(":visible")){this.open()}else{this.close()}},click:function(a1){if(s(a1.target).closest(".t-tool-icon").length>0){this.select()}else{this.toggle()}},value:function(a1){if(!a1){return this.selectedColor}a1=D.toHex(a1);this.selectedColor=a1;s(".t-selected-color",this.element).css("background-color",a1)},popup:function(){if(!this.$popup){this.$popup=s(ar.colorpicker.buildPopup(this)).hide().appendTo(document.body).find("*").attr("unselectable","on").end()}return this.$popup}};s.extend(ar.colorpicker,{buildPopup:function(a1){var a4=new ar.stringBuilder();a4.cat('<div class="t-popup t-group t-colorpicker-popup">').cat('<ul class="t-reset">');var a6=a1.data;var a3=(a1.value()||"").substring(1);for(var a2=0,a5=a6.length;a2<a5;a2++){a4.cat('<li class="t-item').catIf(" t-selected",a6[a2]==a3).cat('" style="background-color:#').cat(a6[a2]).cat('"></li>')}a4.cat("</ul></div>");return a4.string()}});s.fn.tColorPicker=function(a1){return ar.create(this,{name:"tColorPicker",init:function(a2,a3){return new ar.colorpicker(a2,a3)},options:a1})};s.fn.tColorPicker.defaults={data:"000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7".split(","),selectedColor:null,effects:ar.fx.slide.defaults()};function aV(){var a2=new y([{tags:H}]);function a1(a3){return a3.style.marginLeft||0}this.apply=function(a8){var a6=a2.findSuitable(a8);if(a6.length){var a5=[];for(var a4=0;a4<a6.length;a4++){if(D.is(a6[a4],"li")){if(s(a6[a4]).index()==0){a5.push(a6[a4].parentNode)}else{if(s.inArray(a6[a4].parentNode,a5)<0){a5.push(a6[a4])}}}else{a5.push(a6[a4])}}while(a5.length){var a9=a5.shift();if(D.is(a9,"li")){var bc=a9.parentNode;var a7=s(a9).prev("li");var bb=a7.find(">ul")[0];if(!bb){bb=D.create(a9.ownerDocument,D.name(bc));a7.append(bb)}while(a9&&a9.parentNode==bc){bb.appendChild(a9);a9=a5.shift()}}else{var a3=parseInt(a1(a9))+30;D.style(a9,{marginLeft:a3})}}}else{var ba=new W([{tags:H}],{style:{marginLeft:30}});ba.apply(a8)}};this.remove=function(a5){var a7=a2.findSuitable(a5);for(var a3=0;a3<a7.length;a3++){var a4=s(a7[a3]);if(a4.is("li")){var ba=a4.parent();var a6=ba.parent();if(a6.is("li")&&!a1(ba[0])){var a9=a4.nextAll("li");if(a9.length){s(ba[0].cloneNode(false)).appendTo(a4).append(a9)}a4.insertAfter(a6);if(!ba.children("li").length){ba.remove()}continue}else{a4=ba}}var a8=parseInt(a1(a4[0]))-30;D[a8<=0?"unstyle":"style"](a4[0],{marginLeft:a8})}}}function o(a1){a1.formatter={toggle:function(a2){new aV().apply(U.nodes(a2))}};c.call(this,a1)}function S(a1){a1.formatter={toggle:function(a2){new aV().remove(U.nodes(a2))}};c.call(this,a1)}function ag(){X.call(this,{command:S});var a1=new y([{tags:H}]);this.init=function(a2){a2.attr("unselectable","on").addClass("t-state-disabled")};this.update=function(a2,a6){var a4=a1.findSuitable(a6),a5,a7;for(var a3=0;a3<a4.length;a3++){a5=a4[a3].style.marginLeft;if(!a5){a7=s(a4[a3]).parents("ul,ol").length;a5=(D.is(a4[a3],"li")&&a7>1)||(D.ofType(a4[a3],["ul","ol"])&&a7>0)}if(a5){a2.removeClass("t-state-disabled");return}}a2.addClass("t-state-disabled").removeClass("t-state-hover")}}function aE(a1){this.editor=a1;this.formats=[]}aE.prototype={apply:function(a5){if(!this.hasPending()){return}var a4=new ac();a4.addCaret(a5);var a1=a5.startContainer.childNodes[a5.startOffset];var a7=a1.previousSibling;if(!a7.nodeValue){a7=a7.previousSibling}a5.setStart(a7,a7.nodeValue.length-1);a4.add(a5);if(j(a5).length==0){a4.remove(a5);a5.collapse(true);this.editor.selectRange(a5);return}var a3=a4.end.previousSibling.previousSibling;var a9,a6=this.formats;for(var a2=0;a2<a6.length;a2++){a9=a6[a2];var a8=a9.command(s.extend({range:a5},a9.params));a8.editor=this.editor;a8.exec();a5.selectNode(a3)}a4.remove(a5);if(a3.parentNode){a5.setStart(a3,1);a5.collapse(true)}this.clear();this.editor.selectRange(a5)},hasPending:function(){return this.formats.length>0},isPending:function(a1){return !!this.getPending(a1)},getPending:function(a2){var a3=this.formats;for(var a1=0;a1<a3.length;a1++){if(a3[a1].name==a2){return a3[a1]}}return},toggle:function(a2){var a3=this.formats;for(var a1=0;a1<a3.length;a1++){if(a3[a1].name==a2.name){if(a3[a1].params&&a3[a1].params.value!=a2.params.value){a3[a1].params.value=a2.params.value}else{a3.splice(a1,1)}return}}a3.push(a2)},clear:function(){this.formats=[]}};function ax(a1,a6){a1.hide();var a5=s("<iframe />",{src:'javascript:"<html></html>"',frameBorder:"0",className:"t-content"}).css("display","").insertBefore(a1)[0];var a2=a5.contentWindow||a5;var a4=a2.document||a5.contentDocument;var a3=a1.val().replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/ig,"$1");if(!a3.length&&s.browser.mozilla){a3='<br _moz_dirty="true" />'}a4.designMode="On";a4.open();a4.write(new ar.stringBuilder().cat("<!DOCTYPE html><html><head>").cat('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />').cat('<style type="text/css">').cat("html,body{padding:0;margin:0;font-family:Verdana,Geneva,sans-serif;background:#fff;}").cat("html{font-size:100%}body{font-size:.75em;line-height:1.5;padding-top:1px;margin-top:-1px;").catIf("direction:rtl;",a1.closest(".t-rtl").length).cat("}").cat("h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}").cat("p{margin:0 0 1em;padding:0 .2em}.t-marker{display:none;}.t-paste-container{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}").cat("ul,ol{padding-left:2.5em}").cat("a{color:#00a}").cat("code{font-size:1.23em}").cat("</style>").cat(s.map(a6,function(a7){return['<link type="text/css" href="',a7,'" rel="stylesheet"/>'].join("")}).join("")).cat('</head><body spellcheck="false">').cat(a3).cat("</body></html>").string());a4.close();return a2}function V(a1){ar.trigger(a1.element,"selectionChange")}function aI(a2){var a1=true;a2.window=ax(s(a2.textarea),a2.stylesheets);a2.document=a2.window.contentDocument||a2.window.document;a2.body=a2.document.body;s(a2.document).bind({keydown:function(a5){var a3=a2.keyboard.toolFromShortcut(a2.tools,a5);if(a3){a5.preventDefault();a2.exec(a3);return false}if(a2.keyboard.isTypingKey(a5)&&a2.pendingFormats.hasPending()){if(a1){a1=false}else{var a4=a2.getRange();a2.pendingFormats.apply(a4);a2.selectRange(a4)}}a2.keyboard.clearTimeout();a2.keyboard.keydown(a5)},keyup:function(a5){var a4=[8,9,33,34,35,36,37,38,39,40,40,45,46];if(s.browser.mozilla&&a5.keyCode==8){aK(a2,a5)}if(s.inArray(a5.keyCode,a4)>-1||(a5.keyCode==65&&a5.ctrlKey&&!a5.altKey&&!a5.shiftKey)){a2.pendingFormats.clear();V(a2)}if(a2.keyboard.isTypingKey(a5)){if(a2.pendingFormats.hasPending()){var a3=a2.getRange();a2.pendingFormats.apply(a3);a2.selectRange(a3)}}else{a1=true}a2.keyboard.keyup(a5)},mousedown:function(a3){a2.pendingFormats.clear();var a4=s(a3.target);if(!s.browser.gecko&&a3.which==2&&a4.is("a[href]")){window.open(a4.attr("href"),"_new")}},mouseup:function(){V(a2)}});s(a2.window).bind("blur",function(){var a3=a2.textarea.value,a4=a2.encodedValue();a2.update(a4);if(a4!=a3){ar.trigger(a2.element,"change")}});s(a2.body).bind("cut paste",function(a3){a2.clipboard["on"+a3.type](a3)})}ar.editor=function(a1,a2){if(/Mobile.*Safari/.test(navigator.userAgent)){return}var a3=this;this.element=a1;var a4=s(a1);a4.closest("form").bind("submit",function(){a3.update()});s.extend(this,a2);ar.bind(this,{load:this.onLoad,selectionChange:this.onSelectionChange,change:this.onChange,execute:this.onExecute,error:this.onError});for(var a7 in this.tools){this.tools[a7].name=a7.toLowerCase()}this.textarea=a4.find("textarea").attr("autocomplete","off")[0];aI(this);this.keyboard=new aH([new aR(this),new A(this)]);this.clipboard=new aA(this);this.pendingFormats=new aE(this);this.undoRedoStack=new R();function bb(bc){var bd=s.grep(bc.className.split(" "),function(be){return !/^t-(widget|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(be)});return bd[0]?bd[0].substring(2):"custom"}function a8(bd,bc){if(!bc.key){return bd}return new ar.stringBuilder().cat(bd).cat(" (").catIf("Ctrl + ",bc.ctrl).catIf("Shift + ",bc.shift).catIf("Alt + ",bc.alt).cat(bc.key).cat(")").string()}var a6=".t-editor-toolbar > li > *",a5=".t-editor-button .t-tool-icon",a9=a5+":not(.t-state-disabled)",ba=a5+".t-state-disabled";a4.delegate(a9,"mouseenter",ar.hover).delegate(a9,"mouseleave",ar.leave).delegate(a5,"mousedown",ar.preventDefault).delegate(a9,"click",ar.stopAll(function(bc){a3.exec(bb(this))})).delegate(ba,"click",function(bc){bc.preventDefault()}).find(a6).each(function(){var bg=bb(this),bd=a3.tools[bg],bf=a3.localization[bg],be=s(this);if(!bd){return}if(bg=="fontSize"||bg=="fontName"){var bc=a3.localization[bg+"Inherit"]||aP[bg+"Inherit"];a3[bg][0].Text=bc;be.find("input").val(bc).end().find("span.t-input").text(bc).end()}bd.init(be,{title:a8(bf,bd),editor:a3})}).end().bind("selectionChange",function(){var bd=a3.getRange();a3.selectionRestorePoint=new an(bd);var bc=j(bd);if(!bc.length){bc=[bd.startContainer]}a4.find(a6).each(function(){var be=a3.tools[bb(this)];if(be){be.update(s(this),bc,a3.pendingFormats)}})});s(document).bind("DOMNodeInserted",function(bc){if(s.contains(bc.target,a3.element)||a3.element==bc.target){s(a3.element).find("iframe").remove();aI(a3)}}).bind("mousedown",function(bc){try{if(a3.keyboard.typingInProgress()){a3.keyboard.endTyping(true)}if(!a3.selectionRestorePoint){a3.selectionRestorePoint=new an(a3.getRange())}}catch(bc){}})};function aK(a1,a4){var a2=a1.getRange(),a5=a2.startContainer;if(a5==a1.body.firstChild||!D.isBlock(a5)||(a5.childNodes.length>0&&!(a5.childNodes.length==1&&D.is(a5.firstChild,"br")))){return}var a7=a5.previousSibling;while(a7&&!D.isBlock(a7)){a7=a7.previousSibling}if(!a7){return}var a6=a1.document.createTreeWalker(a7,NodeFilter.SHOW_TEXT,null,false);var a3;while(a3=a6.nextNode()){a7=a3}a2.setStart(a7,af(a7)?a7.nodeValue.length:0);a2.collapse(true);O(a2);D.remove(a5);a4.preventDefault()}s.extend(ar.editor,{BlockFormatFinder:y,BlockFormatter:W,Dom:D,FormatCommand:aJ,GenericCommand:aW,GreedyBlockFormatter:au,GreedyInlineFormatFinder:a0,GreedyInlineFormatter:F,ImageCommand:aO,IndentCommand:o,IndentFormatter:aV,InlineFormatFinder:i,InlineFormatter:b,InsertHtmlCommand:t,Keyboard:aH,LinkCommand:aa,LinkFormatFinder:I,LinkFormatter:aX,ListCommand:ay,ListFormatFinder:ap,ListFormatter:J,MSWordFormatCleaner:f,Marker:ac,NewLineCommand:d,OutdentCommand:S,ParagraphCommand:aS,PendingFormats:aE,RangeEnumerator:aj,RangeUtils:U,RestorePoint:an,SystemHandler:A,TypingHandler:aR,UndoRedoStack:R,UnlinkCommand:ao});ar.editor.prototype={value:function(a3){var a1=this.body;if(a3===undefined){return C(a1)}this.pendingFormats.clear();a3=a3.replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->");a3=a3.replace(/<script([^>]*)>(.*)?<\/script>/ig,"<telerik:script $1>$2</telerik:script>");if(s.browser.mozilla){a3=a3.replace(/<p([^>]*)>(\s*)?<\/p>/ig,'<p $1><br _moz_dirty="" /></p>')}if(s.browser.msie&&parseInt(s.browser.version)<9){a3="<br/>"+a3;var a4="originalsrc",a2="originalhref";a3=a3.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,a2+'="$1"');a3=a3.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,a4+'="$1"');a1.innerHTML=a3;D.remove(a1.firstChild);s(a1).find("telerik\\:script,script,link,img,a").each(function(){var a5=this;if(a5[a2]){a5.setAttribute("href",a5[a2]);a5.removeAttribute(a2)}if(a5[a4]){a5.setAttribute("src",a5[a4]);a5.removeAttribute(a4)}})}else{a1.innerHTML=a3;if(s.browser.msie){g(a1)}}this.selectionRestorePoint=null;this.update()},focus:function(){this.window.focus()},update:function(a1){this.textarea.value=a1||this.encoded?this.encodedValue():this.value()},encodedValue:function(){return D.encode(this.value())},createRange:function(a1){return aQ(a1||this.document)},getSelection:function(){return aZ(this.document)},selectRange:function(a2){this.focus();var a1=this.getSelection();a1.removeAllRanges();a1.addRange(a2)},getRange:function(){var a2=this.getSelection();var a1=a2.rangeCount>0?a2.getRangeAt(0):this.createRange();if(a1.startContainer==this.document&&a1.endContainer==this.document&&a1.startOffset==0&&a1.endOffset==0){a1.setStart(this.body,0);a1.collapse(true)}return a1},selectedHtml:function(){return C(this.getRange().cloneContents())},paste:function(a1){this.clipboard.paste(a1)},exec:function(a4,a1){if(!this.keyboard.typingInProgress()){this.focus();if(this.selectionRestorePoint){this.selectRange(this.selectionRestorePoint.toRange());this.selectionRestorePoint=null}}a4=a4.toLowerCase();var a6="";for(var a3 in this.tools){if(a3.toLowerCase()==a4){a6=this.tools[a3];break}}if(a6){var a2=this.getRange();if(!/undo|redo/i.test(a4)&&a6.willDelayExecution(a2)){this.pendingFormats.toggle({name:a4,params:a1,command:a6.command});V(this);return}var a5=a6.command?a6.command(s.extend({range:a2},a1)):null;ar.trigger(this.element,"execute",{name:a4,command:a5});if(/undo|redo/i.test(a4)){this.undoRedoStack[a4]()}else{if(a5){if(!a5.managesUndoRedo){this.undoRedoStack.push(a5)}a5.editor=this;a5.exec();if(a5.async){a5.change=s.proxy(function(){V(this)},this);return}}}V(this)}}};s.fn.tEditor=function(a1){return ar.create(this,{name:"tEditor",init:function(a2,a3){return new ar.editor(a2,a3)},options:a1})};var ak={bold:[{tags:["strong"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}],italic:[{tags:["em"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}],underline:[{tags:["span"],attr:{style:{textDecoration:"underline"}}}],strikethrough:[{tags:["del"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}],justifyLeft:[{tags:H,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left"}}}],justifyCenter:[{tags:H,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto"}}}],justifyRight:[{tags:H,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right"}}}],justifyFull:[{tags:H,attr:{style:{textAlign:"justify"}}}]};function ae(a3,a2){for(var a1=0;a1<a2.length;a1++){if(s.inArray(a3,a2[a1].tags)>=0){return a2[a1]}}}function X(a1){s.extend(this,a1);this.init=function(a2,a3){a2.attr({unselectable:"on",title:a3.title})};this.command=function(a2){return new a1.command(a2)};this.update=function(){};this.willDelayExecution=function(){return false}}X.exec=function(a2,a3,a1){a2.exec(a3,{value:a1})};function ai(a1){X.call(this,a1);this.command=function(a2){return new aJ(s.extend(a2,{formatter:a1.formatter}))};this.update=function(a2,a6,a4){var a3=a4.isPending(this.name),a5=a1.finder.isFormatted(a6),a7=a3?!a5:a5;a2.toggleClass("t-state-active",a7)}}var Q=function(){return{isFormatted:function(){return false}}};var aP={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertHtml:"Insert HTML",fontName:"Select font family",fontNameInherit:"(inherited font)",fontSize:"Select font size",fontSizeInherit:"(inherited size)",formatBlock:"Format",style:"Styles",emptyFolder:"Empty Folder",uploadFile:"Upload",orderBy:"Arrange by:",orderBySize:"Size",orderByName:"Name",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',deleteFile:'Are you sure you want to delete "{0}"?',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',directoryNotFound:"A directory with this name was not found."};s.fn.tEditor.defaults={localization:aP,formats:ak,encoded:true,stylesheets:[],dialogOptions:{modal:true,resizable:false,draggable:true,effects:{list:[{name:"toggle"}]}},fontName:[{Text:aP.fontNameInherit,Value:"inherit"},{Text:"Arial",Value:"Arial,Helvetica,sans-serif"},{Text:"Courier New",Value:"'Courier New',Courier,monospace"},{Text:"Georgia",Value:"Georgia,serif"},{Text:"Impact",Value:"Impact,Charcoal,sans-serif"},{Text:"Lucida Console",Value:"'Lucida Console',Monaco,monospace"},{Text:"Tahoma",Value:"Tahoma,Geneva,sans-serif"},{Text:"Times New Roman",Value:"'Times New Roman',Times,serif"},{Text:"Trebuchet MS",Value:"'Trebuchet MS',Helvetica,sans-serif"},{Text:"Verdana",Value:"Verdana,Geneva,sans-serif"}],fontSize:[{Text:aP.fontSizeInherit,Value:"inherit"},{Text:"1 (8pt)",Value:"xx-small"},{Text:"2 (10pt)",Value:"x-small"},{Text:"3 (12pt)",Value:"small"},{Text:"4 (14pt)",Value:"medium"},{Text:"5 (18pt)",Value:"large"},{Text:"6 (24pt)",Value:"x-large"},{Text:"7 (36pt)",Value:"xx-large"}],formatBlock:[{Text:"Paragraph",Value:"p"},{Text:"Quotation",Value:"blockquote"},{Text:"Heading 1",Value:"h1"},{Text:"Heading 2",Value:"h2"},{Text:"Heading 3",Value:"h3"},{Text:"Heading 4",Value:"h4"},{Text:"Heading 5",Value:"h5"},{Text:"Heading 6",Value:"h6"}],tools:{bold:new Y({key:"B",ctrl:true,format:ak.bold}),italic:new Y({key:"I",ctrl:true,format:ak.italic}),underline:new Y({key:"U",ctrl:true,format:ak.underline}),strikethrough:new Y({format:ak.strikethrough}),undo:{key:"Z",ctrl:true},redo:{key:"Y",ctrl:true},insertLineBreak:new X({key:13,shift:true,command:d}),insertParagraph:new X({key:13,command:aS}),justifyCenter:new P({format:ak.justifyCenter}),justifyLeft:new P({format:ak.justifyLeft}),justifyRight:new P({format:ak.justifyRight}),justifyFull:new P({format:ak.justifyFull}),insertUnorderedList:new aN({tag:"ul"}),insertOrderedList:new aN({tag:"ol"}),createLink:new X({key:"K",ctrl:true,command:aa}),unlink:new aT({key:"K",ctrl:true,shift:true}),insertImage:new X({command:aO}),indent:new X({command:o}),outdent:new ag(),insertHtml:new x(),style:new ab(),fontName:new aC({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName"}),fontSize:new aC({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize"}),formatBlock:new n(),foreColor:new aY({cssAttr:"color",domAttr:"color",name:"foreColor"}),backColor:new aY({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor"})}}})(jQuery);