1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-12 11:15:43 +02:00
Sonarr/NzbDrone.Web/Scripts/2010.2.825/telerik.editor.min.js
2010-10-02 12:01:43 -07:00

1 line
63 KiB
JavaScript

(function(s){var ao=s.telerik;function F(aY){var aX={};for(var aW=0;aW<aY.length;aW++){aX[aY[aW]]=true}return aX}var aH=F("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(","));var G="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 L=F(G);var aP=F("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 K=F("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(","));function g(aW){if(aW.nodeType==1){aW.normalize()}}function p(aW){var aX=0;while(aW=aW.previousSibling){aX++}return aX}function ac(aW){return aW&&aW.nodeValue!==null&&aW.data!==null}function k(aW,aX){try{return !ac(aW)&&(s.contains(aW,ac(aX)?aX.parentNode:aX)||aX.parentNode==aW)}catch(aY){return false}}function y(aX,aW){return k(aX,aW)||aX==aW}function az(aX,aW){if(k(aX,aW)){while(aW&&aW.parentNode!=aX){aW=aW.parentNode}}return aW}function aD(aW){return ac(aW)?aW.length:aW.childNodes.length}function ar(aW,aY){var aX=aW.cloneNode(false);aW.deleteData(aY,aW.length);aX.deleteData(0,aY);C.insertAfter(aX,aW)}function A(aX,aY){for(var aZ in aY){var aW=aX[aZ];if(aZ=="float"){aW=aX[s.support.cssFloat?"cssFloat":"styleFloat"]}if(typeof aW=="object"){if(!A(aW,aY[aZ])){return false}}else{if(aW!=aY[aZ]){return false}}}return true}var aB=/^\s+$/;var e=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i;var ae=("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 C={blockParentOrBody:function(aW){return C.parentOfType(aW,G)||aW.ownerDocument.body},toHex:function(aW){var aX=e.exec(aW);if(!aX){return aW}return"#"+s.map(aX.slice(1),function(aY){return aY=parseInt(aY).toString(16),aY.length>1?aY:"0"+aY}).join("")},encode:function(aW){return aW.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00a0/g,"&nbsp;")},name:function(aW){return aW.nodeName.toLowerCase()},significantChildNodes:function(aW){return s.grep(aW.childNodes,function(aX){return aX.nodeType!=3||!C.isWhitespace(aX)})},lastTextNode:function(aX){if(aX.nodeType==3){return aX}var aW=null;for(var aY=aX.lastChild;aY;aY=aY.previousSibling){if(aW=C.lastTextNode(aY)){return aW}}return aW},is:function(aW,aX){return C.name(aW)==aX},isMarker:function(aW){return aW.className=="t-marker"},isWhitespace:function(aW){return aB.test(aW.nodeValue)},isBlock:function(aW){return L[C.name(aW)]},isEmpty:function(aW){return aH[C.name(aW)]},isInline:function(aW){return aP[C.name(aW)]},scrollTo:function(aW){aW.ownerDocument.body.scrollTop=s(ac(aW)?aW.parentNode:aW).offset().top},insertAt:function(aX,aW,aY){aX.insertBefore(aW,aX.childNodes[aY]||null)},insertBefore:function(aW,aX){return aX.parentNode.insertBefore(aW,aX)},insertAfter:function(aW,aX){return aX.parentNode.insertBefore(aW,aX.nextSibling)},remove:function(aW){aW.parentNode.removeChild(aW)},trim:function(aX){for(var aW=aX.childNodes.length-1;aW>=0;aW--){var aY=aX.childNodes[aW];if(ac(aY)){if(aY.nodeValue.replace(/\ufeff/g,"").length==0){C.remove(aY)}if(C.isWhitespace(aY)){C.insertBefore(aY,aX)}}else{if(aY.className!="t-marker"){C.trim(aY);if(aY.childNodes.length==0&&!C.isEmpty(aY)){C.remove(aY)}}}}return aX},parentOfType:function(aW,aX){do{aW=aW.parentNode}while(aW&&!(C.ofType(aW,aX)));return aW},ofType:function(aW,aX){return s.inArray(C.name(aW),aX)>=0},changeTag:function(a0,aX){var aZ=C.create(a0.ownerDocument,aX);var a3=a0.attributes;for(var aY=0;aY<a3.length;aY++){var a1=a3[aY];if(a1.specified){var a2=a1.nodeName;var aW=a1.nodeValue;if(a2=="class"){aZ.className=aW}else{if(a2=="style"){aZ.style.cssText=a0.style.cssText}else{aZ.setAttribute(a2,aW)}}}}while(a0.firstChild){aZ.appendChild(a0.firstChild)}C.insertBefore(aZ,a0);C.remove(a0);return aZ},wrap:function(aW,aX){C.insertBefore(aX,aW);aX.appendChild(aW);return aX},unwrap:function(aW){var aX=aW.parentNode;while(aW.firstChild){aX.insertBefore(aW.firstChild,aW)}aX.removeChild(aW)},create:function(aY,aX,aW){return C.attr(aY.createElement(aX),aW)},attr:function(aW,aX){aX=s.extend({},aX);if(aX&&"style" in aX){C.style(aW,aX.style);delete aX.style}return s.extend(aW,aX)},style:function(aW,aX){s(aW).css(aX||{})},unstyle:function(aX,aW){for(var aY in aW){if(aY=="float"){aY=s.support.cssFloat?"cssFloat":"styleFloat"}aX.style[aY]=""}if(aX.style.cssText==""){aX.removeAttribute("style")}},inlineStyle:function(aX,a0,a1){var aY=C.create(aX,a0,a1);aX.body.appendChild(aY);var aW=s(aY);var aZ=s.map(ae,function(a2){return a2+":"+aW.css(a2)}).join(";");aW.remove();return aZ},commonAncestor:function(){var aZ=arguments.length;if(!aZ){return null}if(aZ==1){return arguments[0]}var a0=[];var a1=Infinity;for(var aW=0;aW<aZ;aW++){var a3=[];var a4=arguments[aW];while(a4){a3.push(a4);a4=a4.parentNode}a0.push(a3.reverse());a1=Math.min(a1,a3.length)}if(aZ==1){return a0[0][0]}var a2=null;for(aW=0;aW<a1;aW++){var aY=a0[0][aW];for(var aX=1;aX<aZ;aX++){if(aY!=a0[aX][aW]){return a2}}a2=aY}return a2}};var r="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");function B(aY){var a1=[];var a0={"telerik:script":{start:function(a2){a1.push("<script");aX(a2);a1.push(">")},end:function(){a1.push("</script>")}},b:{start:function(){a1.push("<strong>")},end:function(){a1.push("</strong>")}},i:{start:function(){a1.push("<em>")},end:function(){a1.push("</em>")}},u:{start:function(){a1.push('<span style="text-decoration:underline;">')},end:function(){a1.push("</span>")}},font:{start:function(a4){a1.push('<span style="');var a2=a4.getAttribute("color");var a3=r[a4.getAttribute("size")];var a5=a4.getAttribute("face");if(a2){a1.push("color:");a1.push(C.toHex(a2));a1.push(";")}if(a5){a1.push("font-face:");a1.push(a5);a1.push(";")}if(a3){a1.push("font-size:");a1.push(a3);a1.push(";")}a1.push('">')},end:function(a2){a1.push("</span>")}}};function aX(a3){var a9=[],bi=a3.attributes,bd=s.trim;for(var a7=0,bb=bi.length;a7<bb;a7++){var ba=bi[a7];var a4=ba.nodeName;if(ba.specified||(a4=="value"&&a3.value!="")||(a4=="type"&&ba.nodeValue=="text")){if(a4.indexOf("_moz")<0&&a4!="complete"){a9.push(ba)}}}if(!a9.length){return}a9.sort(function(bj,bk){return bj.nodeName>bk.nodeName?1:bj.nodeName<bk.nodeName?-1:0});for(var a7=0,bb=a9.length;a7<bb;a7++){var ba=a9[a7];var a5=ba.nodeName;var bc=ba.nodeValue;a1.push(" ");a1.push(a5);a1.push('="');if(a5=="style"){var bg=bd(bc||a3.style.cssText).split(";");for(var be=0,a6=bg.length;be<a6;be++){var bh=bg[be];if(bh.length){var a8=bh.split(":");var bf=bd(a8[0].toLowerCase()),a2=bd(a8[1]);if(bf.indexOf("color")>=0){a2=C.toHex(a2)}a1.push(bf);a1.push(":");a1.push(a2);a1.push(";")}}}else{if(a5=="src"||a5=="href"){a1.push(a3.getAttribute(a5,2))}else{a1.push(K[a5]?a5:bc)}}a1.push('"')}}function aW(a2,a3){for(var a4=a2.firstChild;a4;a4=a4.nextSibling){aZ(a4,a3)}}function aZ(a5,a6){var a9=a5.nodeType;if(a9==1){if(a5.attributes._moz_dirty&&C.is(a5,"br")){return}var a3=C.name(a5);var a7=a0[a3];if(a7){a7.start(a5);aW(a5);a7.end(a5);return}a1.push("<");a1.push(a3);aX(a5);if(aH[a3]){a1.push(" />")}else{a1.push(">");aW(a5,a6||C.is(a5,"pre"));a1.push("</");a1.push(a3);a1.push(">")}}else{if(a9==3){var a2=a5.nodeValue;if(!a6&&s.support.leadingWhitespace){var a8=a5.parentNode;var a4=(C.isInline(a8)?a8:a5).previousSibling;if(!a4||a4.innerHTML==""||C.isBlock(a4)){a2=a2.replace(/^[\r\n\v\f\t ]+/,"")}a2=a2.replace(/ +/," ")}a1.push(C.encode(a2))}else{if(a9==4){a1.push("<![CDATA[");a1.push(a5.data);a1.push("]]>")}else{if(a9==8){if(a5.data.indexOf("[CDATA[")<0){a1.push("<!--");a1.push(a5.data);a1.push("-->")}else{a1.push("<!");a1.push(a5.data);a1.push(">")}}}}}}aW(aY);return a1.join("")}var u=0,an=1,a=2,R=3;function q(aX){var aW=aX.startContainer;return aW.nodeType==9?aW:aW.ownerDocument}function D(aW){return aW.getSelection?aW.getSelection():new at(aW.document)}function ai(aX){var aW=q(aX);return aU(aW)}function aU(aW){return D(ax(aW))}function ax(aW){return aW.defaultView||aW.parentWindow}function aj(aW,aX,aZ){function aY(a2){var a0=aW.cloneRange();a0.collapse(a2);a0[a2?"setStartBefore":"setEndAfter"](aX);var a1=a0.extractContents();if(aZ){a1=C.trim(a1)}C[a2?"insertBefore":"insertAfter"](a1,aX)}aY(true);aY(false)}function M(aX){var aY=S.image(aX);if(aY){aX.setStartAfter(aY);aX.setEndAfter(aY)}var aW=ai(aX);aW.removeAllRanges();aW.addRange(aX)}function J(aW){s.extend(this,{ownerDocument:aW,startContainer:aW,endContainer:aW,commonAncestorContainer:aW,startOffset:0,endOffset:0,collapsed:true})}J.prototype={setStart:function(aW,aX){this.startContainer=aW;this.startOffset=aX;v(this);t(this,true)},setEnd:function(aW,aX){this.endContainer=aW;this.endOffset=aX;v(this);t(this,false)},setStartBefore:function(aW){this.setStart(aW.parentNode,p(aW))},setStartAfter:function(aW){this.setStart(aW.parentNode,p(aW)+1)},setEndBefore:function(aW){this.setEnd(aW.parentNode,p(aW))},setEndAfter:function(aW){this.setEnd(aW.parentNode,p(aW)+1)},selectNode:function(aW){this.setStartBefore(aW);this.setEndAfter(aW)},selectNodeContents:function(aW){this.setStart(aW,0);this.setEnd(aW,aW[aW.nodeType===1?"childNodes":"nodeValue"].length)},collapse:function(aW){if(aW){this.setEnd(this.startContainer,this.startOffset)}else{this.setStart(this.endContainer,this.endOffset)}},deleteContents:function(){var aX=this.cloneRange();if(this.startContainer!=this.commonAncestorContainer){this.setStartAfter(az(this.commonAncestorContainer,this.startContainer))}this.collapse(true);(function aW(aY){while(aY.next()){aY.hasPartialSubtree()?aW(aY.getSubtreeIterator()):aY.remove()}})(new l(aX))},cloneContents:function(){var aW=q(this);return(function aX(a0){for(var aZ,aY=aW.createDocumentFragment();aZ=a0.next();){aZ=aZ.cloneNode(!a0.hasPartialSubtree());if(a0.hasPartialSubtree()){aZ.appendChild(aX(a0.getSubtreeIterator()))}aY.appendChild(aZ)}return aY})(new l(this))},extractContents:function(){var aX=this.cloneRange();if(this.startContainer!=this.commonAncestorContainer){this.setStartAfter(az(this.commonAncestorContainer,this.startContainer))}this.collapse(true);var aY=this;var aW=q(this);return(function aZ(a2){for(var a1,a0=aW.createDocumentFragment();a1=a2.next();){a2.hasPartialSubtree()?a1=a1.cloneNode(false):a2.remove(aY.originalRange);if(a2.hasPartialSubtree()){a1.appendChild(aZ(a2.getSubtreeIterator()))}a0.appendChild(a1)}return a0})(new l(aX))},insertNode:function(aW){if(ac(this.startContainer)){if(this.startOffset!=this.startContainer.nodeValue.length){ar(this.startContainer,this.startOffset)}C.insertAfter(aW,this.startContainer)}else{C.insertAt(this.startContainer,aW,this.startOffset)}this.setStart(this.startContainer,this.startOffset)},cloneRange:function(){return s.extend(new J(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 aX=this.startContainer.nodeName,aW=this.endContainer.nodeName;return[aX=="#text"?this.startContainer.nodeValue:aX,"(",this.startOffset,") : ",aW=="#text"?this.endContainer.nodeValue:aW,"(",this.endOffset,")"].join("")}};function m(aY,aW,a3,a0){if(aY==aW){return a0-a3}var a2=aW;while(a2&&a2.parentNode!=aY){a2=a2.parentNode}if(a2){return p(a2)-a3}a2=aY;while(a2&&a2.parentNode!=aW){a2=a2.parentNode}if(a2){return a0-p(a2)-1}var a1=C.commonAncestor(aY,aW);var aZ=aY;while(aZ&&aZ.parentNode!=a1){aZ=aZ.parentNode}if(!aZ){aZ=a1}var aX=aW;while(aX&&aX.parentNode!=a1){aX=aX.parentNode}if(!aX){aX=a1}if(aZ==aX){return 0}return p(aX)-p(aZ)}function t(aX,aY){function aW(a0){try{return m(a0.startContainer,a0.endContainer,a0.startOffset,a0.endOffset)<0}catch(aZ){return true}}if(aW(aX)){if(aY){aX.commonAncestorContainer=aX.endContainer=aX.startContainer;aX.endOffset=aX.startOffset}else{aX.commonAncestorContainer=aX.startContainer=aX.endContainer;aX.startOffset=aX.endOffset}aX.collapsed=true}}function v(aX){aX.collapsed=aX.startContainer==aX.endContainer&&aX.startOffset==aX.endOffset;var aW=aX.startContainer;while(aW&&aW!=aX.endContainer&&!k(aW,aX.endContainer)){aW=aW.parentNode}aX.commonAncestorContainer=aW}function aL(aW){return aW.createRange?aW.createRange():new J(aW)}function l(aX){s.extend(this,{range:aX,_current:null,_next:null,_end:null});if(aX.collapsed){return}var aW=aX.commonAncestorContainer;this._next=aX.startContainer==aW&&!ac(aX.startContainer)?aX.startContainer.childNodes[aX.startOffset]:az(aW,aX.startContainer);this._end=aX.endContainer==aW&&!ac(aX.endContainer)?aX.endContainer.childNodes[aX.endOffset]:az(aW,aX.endContainer).nextSibling}l.prototype={hasNext:function(){return !!this._next},next:function(){var aW=this._current=this._next;this._next=this._current&&this._current.nextSibling!=this._end?this._current.nextSibling:null;if(ac(this._current)){if(this.range.endContainer==this._current){(aW=aW.cloneNode(true)).deleteData(this.range.endOffset,aW.length-this.range.endOffset)}if(this.range.startContainer==this._current){(aW=aW.cloneNode(true)).deleteData(0,this.range.startOffset)}}return aW},traverse:function(aX){function aW(){this._current=this._next;this._next=this._current&&this._current.nextSibling!=this._end?this._current.nextSibling:null;return this._current}var aY;while(aY=aW.call(this)){if(this.hasPartialSubtree()){this.getSubtreeIterator().traverse(aX)}else{aX(aY)}}return aY},remove:function(a1){var a0=this.range.startContainer==this._current;var aY=this.range.endContainer==this._current;if(ac(this._current)&&(a0||aY)){var aX=a0?this.range.startOffset:0;var aW=aY?this.range.endOffset:this._current.length;var a3=aW-aX;if(a1&&(a0||aY)){if(this._current==a1.startContainer&&aX<=a1.startOffset){a1.startOffset-=a3}if(this._current==a1.endContainer&&aW<=a1.endOffset){a1.endOffset-=a3}}this._current.deleteData(aX,a3)}else{var a2=this._current.parentNode;if(a1&&(this.range.startContainer==a2||this.range.endContainer==a2)){var aZ=p(this._current);if(a2==a1.startContainer&&aZ<=a1.startOffset){a1.startOffset-=1}if(a2==a1.endContainer&&aZ<a1.endOffset){a1.endOffset-=1}}C.remove(this._current)}},hasPartialSubtree:function(){return !ac(this._current)&&(y(this._current,this.range.startContainer)||y(this._current,this.range.endContainer))},getSubtreeIterator:function(){var aW=this.range.cloneRange();aW.selectNodeContents(this._current);if(y(this._current,this.range.startContainer)){aW.setStart(this.range.startContainer,this.range.startOffset)}if(y(this._current,this.range.endContainer)){aW.setEnd(this.range.endContainer,this.range.endOffset)}return new l(aW)}};function at(aW){this.ownerDocument=aW;this.rangeCount=1}at.prototype={addRange:function(aX){var aW=this.ownerDocument.body.createTextRange();h(aW,aX,false);h(aW,aX,true);aW.select()},removeAllRanges:function(){this.ownerDocument.selection.empty()},getRangeAt:function(){var aY,aX=new J(this.ownerDocument),aW=this.ownerDocument.selection;try{aY=aW.createRange()}catch(aZ){return aX}if(aW.type=="Control"){aX.selectNode(aY.item(0))}else{aG(aY,aX,true);aG(aY,aX,false);if(aX.startContainer.nodeType==9){aX.setStart(aX.endContainer,aX.startOffset)}if(aX.endContainer.nodeType==9){aX.setEnd(aX.startContainer,aX.endOffset)}if(aY.compareEndPoints("StartToEnd",aY)==0){aX.collapse(false)}}return aX}};function h(a3,aX,aW){var a0=aX[aW?"startContainer":"endContainer"];var a1=aX[aW?"startOffset":"endOffset"],a5=0;var aY=ac(a0)?a0:a0.childNodes[a1]||null;var a2=ac(a0)?a0.parentNode:a0;if(a0.nodeType==3||a0.nodeType==4){a5=a1}var a4=a2.insertBefore(C.create(aX.ownerDocument,"a"),aY);var aZ=aX.ownerDocument.body.createTextRange();aZ.moveToElementText(a4);C.remove(a4);aZ[aW?"moveStart":"moveEnd"]("character",a5);aZ.collapse(false);a3.setEndPoint(aW?"StartToStart":"EndToStart",aZ)}function aG(a1,aX,aW){var aZ=C.create(aX.ownerDocument,"a"),a2=a1.duplicate();a2.collapse(aW);var aY=a2.parentElement();do{aY.insertBefore(aZ,aZ.previousSibling);a2.moveToElementText(aZ)}while(a2.compareEndPoints(aW?"StartToStart":"StartToEnd",a1)>0&&aZ.previousSibling);a2.setEndPoint(aW?"EndToStart":"EndToEnd",a1);var a0=aZ.nextSibling;if(!a0){a0=aZ.previousSibling;if(a0&&ac(a0)){aX.setEnd(a0,a0.nodeValue.length);C.remove(aZ)}else{aX.selectNodeContents(aY);C.remove(aZ);aX.endOffset-=1}return}C.remove(aZ);if(ac(a0)){aX[aW?"setStart":"setEnd"](a0,a2.text.length)}else{aX[aW?"setStartBefore":"setEndBefore"](a0)}}function ag(aW){this.enumerate=function(){var aY=[];function aX(aZ){if(C.is(aZ,"img")||(aZ.nodeType==3&&!C.isWhitespace(aZ))){aY.push(aZ)}else{aZ=aZ.firstChild;while(aZ){aX(aZ);aZ=aZ.nextSibling}}}new l(aW).traverse(aX);return aY}}function j(aW){return new ag(aW).enumerate()}function X(a0){var aW=[];for(var aX=0,aZ=a0.length;aX<aZ;aX++){var aY=C.parentOfType(a0[aX],G);if(aY&&s.inArray(aY,aW)<0){aW.push(aY)}}return aW}function aC(aX){var aW=[];new l(aX).traverse(function(aY){if(aY.className=="t-marker"){aW.push(aY)}});return aW}function ak(aY){var a1=q(aY);this.body=a1.body;this.html=this.body.innerHTML;function a0(a5){var a3=0,a2=a5.nodeType;while(a5=a5.previousSibling){var a4=a5.nodeType;if(a4!=3||a2!=a4){a3++}a2=a4}return a3}function aZ(a2,a3){if(a2.nodeType==3){while((a2=a2.previousSibling)&&a2.nodeType==3){a3+=a2.nodeValue.length}}return a3}function aX(a2){var a3=[];while(a2!=a1){a3.push(a0(a2));a2=a2.parentNode}return a3}function aW(a4){var a3=a1,a2=a4.length;while(a2--){a3=a3.childNodes[a4[a2]]}return a3}this.startContainer=aX(aY.startContainer);this.endContainer=aX(aY.endContainer);this.startOffset=aZ(aY.startContainer,aY.startOffset);this.endOffset=aZ(aY.endContainer,aY.endOffset);this.toRange=function(){var a2=aY.cloneRange();a2.setStart(aW(this.startContainer),this.startOffset);a2.setEnd(aW(this.endContainer),this.endOffset);return a2}}function aa(){var aW;this.addCaret=function(aX){aW=C.create(q(aX),"span",{className:"t-marker"});aX.insertNode(aW);aX.selectNode(aW);return aW};this.removeCaret=function(aY){var a0=aW.previousSibling;var a3=0;if(a0){a3=ac(a0)?a0.nodeValue.length:p(a0)}var a2=aW.parentNode;var a1=a0?p(a0):0;C.remove(aW);g(a2);var aX=a2.childNodes[a1];if(ac(aX)){aY.setStart(aX,a3)}else{if(aX){var aZ=C.lastTextNode(aX);if(aZ){aY.setStart(aZ,aZ.nodeValue.length)}else{aY[a0?"setStartAfter":"setStartBefore"](aX)}}else{if(!s.browser.msie&&a2.innerHTML==""){a2.innerHTML='<br _moz_dirty="" />'}aY.selectNodeContents(a2)}}aY.collapse(true)};this.add=function(aX,aZ){if(aZ&&aX.collapsed){this.addCaret(aX);aX=S.expand(aX)}var aY=aX.cloneRange();aY.collapse(false);this.end=C.create(q(aX),"span",{className:"t-marker"});aY.insertNode(this.end);aY=aX.cloneRange();aY.collapse(true);this.start=this.end.cloneNode(true);aY.insertNode(this.start);aX.setStartBefore(this.start);aX.setEndAfter(this.end);g(aX.commonAncestorContainer);return aX};this.remove=function(a4){var aX=this.start,a9=this.end;g(a4.commonAncestorContainer);while(!aX.nextSibling&&aX.parentNode){aX=aX.parentNode}while(!a9.previousSibling&&a9.parentNode){a9=a9.parentNode}var aZ=(aX.previousSibling&&aX.previousSibling.nodeType==3)&&(aX.nextSibling&&aX.nextSibling.nodeType==3);var a5=(a9.previousSibling&&a9.previousSibling.nodeType==3)&&(a9.nextSibling&&a9.nextSibling.nodeType==3);aX=aX.nextSibling;a9=a9.previousSibling;var a8=false;var a2=false;if(aX==this.end){a2=!!this.start.previousSibling;aX=a9=this.start.previousSibling||this.end.nextSibling;a8=true}C.remove(this.start);C.remove(this.end);var a7=a8?ac(aX)?aX.nodeValue.length:aX.childNodes.length:0;var a0=ac(a9)?a9.nodeValue.length:a9.childNodes.length;if(aX.nodeType==3){while(aX.previousSibling&&aX.previousSibling.nodeType==3){aX=aX.previousSibling;a7+=aX.nodeValue.length}}if(a9.nodeType==3){while(a9.previousSibling&&a9.previousSibling.nodeType==3){a9=a9.previousSibling;a0+=a9.nodeValue.length}}var a3=p(aX),a6=aX.parentNode;var a1=p(a9),aY=a9.parentNode;for(var bb=aX;bb.previousSibling;bb=bb.previousSibling){if(bb.nodeType==3&&bb.previousSibling.nodeType==3){a3--}}for(var ba=a9;ba.previousSibling;ba=ba.previousSibling){if(ba.nodeType==3&&ba.previousSibling.nodeType==3){a1--}}g(a6);if(aX.nodeType==3){aX=a6.childNodes[a3]}g(aY);if(a9.nodeType==3){a9=aY.childNodes[a1]}if(a8){if(aX.nodeType==3){a4.setStart(aX,a7)}else{a4[a2?"setStartAfter":"setStartBefore"](aX)}a4.collapse(true)}else{if(aX.nodeType==3){a4.setStart(aX,a7)}else{a4.setStartBefore(aX)}if(a9.nodeType==3){a4.setEnd(a9,a0)}else{a4.setEndAfter(a9)}}if(aW){this.removeCaret(a4)}}}var ap=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/;var S={nodes:function(aX){var aW=j(aX);if(!aW.length){aX.selectNodeContents(aX.commonAncestorContainer);aW=j(aX);if(!aW.length){aW=C.significantChildNodes(aX.commonAncestorContainer)}}return aW},image:function(aX){var aW=[];new l(aX).traverse(function(aY){if(C.is(aY,"img")){aW.push(aY)}});if(aW.length==1){return aW[0]}},expand:function(aX){var aY=aX.cloneRange();var a1=aY.startContainer.childNodes[aY.startOffset==0?0:aY.startOffset-1];var a2=aY.endContainer.childNodes[aY.endOffset];if(!ac(a1)||!ac(a2)){return aY}var aZ=a1.nodeValue;var a0=a2.nodeValue;if(aZ==""||a0==""){return aY}var aW=aZ.split("").reverse().join("").search(ap);var a3=a0.search(ap);if(aW==0||a3==0){return aY}a3=a3==-1?a0.length:a3;aW=aW==-1?0:aZ.length-aW;aY.setStart(a1,aW);aY.setEnd(a2,a3);return aY},isExpandable:function(aX){var a2=aX.startContainer;var a1=q(aX);if(a2==a1||a2==a1.body){return false}var aY=aX.cloneRange();var aW=a2.nodeValue;if(!aW){return false}var aZ=aW.substring(0,aY.startOffset);var a0=aW.substring(aY.startOffset);var a3=0,a4=0;if(aZ!=""){a3=aZ.split("").reverse().join("").search(ap)}if(a0!=""){a4=a0.search(ap)}return a3!=0&&a4!=0}};function c(aX){var aY=new ak(aX.range);var aW=new aa();this.formatter=aX.formatter;this.getRange=function(){return aY.toRange()};this.lockRange=function(aZ){return aW.add(this.getRange(),aZ)};this.releaseRange=function(aZ){aW.remove(aZ);M(aZ)};this.undo=function(){aY.body.innerHTML=aY.html;M(aY.toRange())};this.redo=function(){this.exec()};this.exec=function(){var aZ=this.lockRange(true);this.formatter.editor=this.editor;this.formatter.toggle(aZ);this.releaseRange(aZ)}}function aR(aY,aX){var aW=aY.body;this.redo=function(){aW.innerHTML=aX.html;M(aX.toRange())};this.undo=function(){aW.innerHTML=aY.html;M(aY.toRange())}}function aM(aW){c.call(this,aW);this.managesUndoRedo=true;this.exec=function(){var aY=this.editor;var aX=aY.getRange();var aZ=new ak(aX);aY.clipboard.paste(aW.value||"");aY.undoRedoStack.push(new aR(aZ,new ak(aY.getRange())));aY.focus()}}function w(){V.call(this);this.command=function(aW){return new aM(aW)};this.update=function(aW,aX){aW.data("tSelectBox").close()};this.init=function(aY,aW){var aX=aW.editor;aY.tSelectBox({data:aX.insertHtml,onItemCreate:function(aZ){aZ.html='<span unselectable="on">'+aZ.dataItem.Text+"</span>"},onChange:function(aZ){V.exec(aX,"insertHtml",aZ.value)},highlightFirst:false}).find(".t-input").html(aX.localization.insertHtml)}}function P(){var aX=[],aW=-1;this.push=function(aY){aX=aX.slice(0,aW+1);aW=aX.push(aY)-1};this.undo=function(){if(this.canUndo()){aX[aW--].undo()}};this.redo=function(){if(this.canRedo()){aX[++aW].redo()}};this.canUndo=function(){return aW>=0};this.canRedo=function(){return aW!=aX.length-1}}function aK(aW){this.keydown=function(aZ){var aY=aW.keyboard;var aX=aY.isTypingKey(aZ);if(!aX){au(aW)}if(aX&&!aY.typingInProgress()){this.startRestorePoint=new ak(aW.getRange());aY.startTyping(s.proxy(function(){this.endRestorePoint=new ak(aW.getRange());aW.undoRedoStack.push(new aR(this.startRestorePoint,this.endRestorePoint))},this));return true}return false};this.keyup=function(aX){var aY=aW.keyboard;if(aY.typingInProgress()){aY.endTyping();return true}return false}}function z(aX){var aW=false;this.createUndoCommand=function(){this.endRestorePoint=new ak(aX.getRange());aX.undoRedoStack.push(new aR(this.startRestorePoint,this.endRestorePoint));this.startRestorePoint=this.endRestorePoint};this.changed=function(){if(this.startRestorePoint){return this.startRestorePoint.html!=aX.body.innerHTML}return false},this.keydown=function(aY){var aZ=aX.keyboard;if(aZ.isModifierKey(aY)){if(aZ.typingInProgress()){aZ.endTyping(true)}this.startRestorePoint=new ak(aX.getRange());return true}if(aZ.isSystem(aY)){aW=true;if(this.changed()){aW=false;this.createUndoCommand()}return true}return false};this.keyup=function(aY){if(aW&&this.changed()){aW=false;this.createUndoCommand(aY);return true}return false}}function aE(aX){var aZ=false;var a2;var aY;function aW(a3){return(a3>=48&&a3<=90)||(a3>=96&&a3<=111)||(a3>=186&&a3<=192)||(a3>=219&&a3<=222)}this.toolFromShortcut=function(a5,a7){var a4=String.fromCharCode(a7.keyCode);for(var a6 in a5){var a3=a5[a6];if((a3.key==a4||a3.key==a7.keyCode)&&!!a3.ctrl==a7.ctrlKey&&!!a3.alt==a7.altKey&&!!a3.shift==a7.shiftKey){return a6}}};this.isTypingKey=function(a4){var a3=a4.keyCode;return(aW(a3)&&!a4.ctrlKey&&!a4.altKey)||a3==32||a3==13||a3==8||(a3==46&&!a4.shiftKey&&!a4.ctrlKey&&!a4.altKey)};this.isModifierKey=function(a4){var a3=a4.keyCode;return(a3==17&&!a4.shiftKey&&!a4.altKey)||(a3==16&&!a4.ctrlKey&&!a4.altKey)||(a3==18&&!a4.ctrlKey&&!a4.shiftKey)};this.isSystem=function(a3){return a3.keyCode==46&&a3.ctrlKey&&!a3.altKey&&!a3.shiftKey};this.startTyping=function(a3){aY=a3;aZ=true};function a0(){aZ=false;aY()}this.endTyping=function(a3){this.clearTimeout();if(a3){a0()}else{a2=window.setTimeout(a0,1000)}};this.typingInProgress=function(){return aZ};this.clearTimeout=function(){window.clearTimeout(a2)};function a1(a5,a4){for(var a3=0;a3<aX.length;a3++){if(aX[a3][a4](a5)){break}}}this.keydown=function(a3){a1(a3,"keydown")};this.keyup=function(a3){a1(a3,"keyup")}}function ay(a0){var aZ=[new f()];function aX(a2){var a3=C.create(a0.document,"div");a3.innerHTML=a2;var a1=a0.document.createDocumentFragment();while(a3.firstChild){a1.appendChild(a3.firstChild)}return a1}function aW(a1){return/<(div|p|ul|ol|table|h[1-6])/i.test(a1)}this.oncut=function(a1){var a2=new ak(a0.getRange());setTimeout(function(){a0.undoRedoStack.push(new aR(a2,new ak(a0.getRange())))})};this.onpaste=function(a4){var a1=a0.getRange();var a3=new ak(a1);var a6=C.create(a0.document,"div",{innerHTML:"\ufeff"});if(!s.browser.webkit){a6.style.display="none"}a0.body.appendChild(a6);if(a0.body.createTextRange){a4.preventDefault();var a5=a0.body.createTextRange();a5.moveToElementText(a6);s(a0.body).unbind("paste");a5.execCommand("paste");s(a0.body).bind("paste",arguments.callee)}else{var a2=a0.createRange();a2.selectNodeContents(a6);M(a2)}setTimeout(function(){M(a1);C.remove(a6);if(C.is(a6.lastChild,"br")){C.remove(a6.lastChild)}a0.clipboard.paste(a6.innerHTML);a0.undoRedoStack.push(new aR(a3,new ak(a0.getRange())))})};function aY(a2,a4){if(a2){return C.parentOfType(a4,["p","ul","ol"])||a4.parentNode}var a1=a4.parentNode;var a3=a4.ownerDocument.body;if(C.isInline(a1)){while(a1.parentNode!=a3&&!C.isBlock(a1.parentNode)){a1=a1.parentNode}}return a1}this.paste=function(a5){for(var a1=0,a3=aZ.length;a1<a3;a1++){if(aZ[a1].applicable(a5)){a5=aZ[a1].clean(a5)}}a5=a5.replace(/^<li/i,"<ul><li").replace(/li>$/g,"li></ul>");var a2=aW(a5);var a4=a0.getRange();a4.deleteContents();if(a4.startContainer==a0.document){a4.selectNodeContents(a0.body)}var a6=new aa();var a9=a6.addCaret(a4);var a8=aY(a2,a9);var a7=false;if(!/body|td/.test(C.name(a8))&&(a2||C.isInline(a8))){a4.selectNode(a9);aj(a4,a8,true);a7=true}var ba=aX(a5);a4.insertNode(ba);a8=aY(a2,a9);if(a7){while(a9.parentNode!=a8){C.unwrap(a9.parentNode)}C.unwrap(a9.parentNode)}g(a4.commonAncestorContainer);a9.style.display="inline";C.scrollTo(a9);a6.removeCaret(a4);M(a4)}}function f(){var aW=[/<!--(.|\n)*?-->/g,"",/mso-[^;"]*;?/ig,"",/<\/?(meta|link|style|o:|v:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:)[^>]*>)?/ig,""];this.applicable=function(aZ){return/class="?Mso|style="[^"]*mso-/i.test(aZ)};function aX(aZ){if(/^[\u2022\u00b7\u00a7\u00d8o\-]\u00a0+/.test(aZ)){return"ul"}if(/^\s*\w+[\.\)]\u00a0{2,}/.test(aZ)){return"ol"}}function aY(bc){var a4=C.create(document,"div",{innerHTML:bc});var bb=s(G.join(","),a4);var a6=-1,a1,ba={ul:{},ol:{}},aZ=a4;for(var a7=0;a7<bb.length;a7++){var a2=bb[a7];var bc=a2.innerHTML.replace(/<\/?\w+[^>]*>/g,"").replace(/&nbsp;/g,"\u00a0");var a5=aX(bc);if(!a5||C.name(a2)!="p"){if(a2.innerHTML==""){C.remove(a2)}else{ba={ul:{},ol:{}};aZ=a4;a6=-1}continue}var a8=parseFloat(a2.style.marginLeft||0);var a9=ba[a5][a8];if(a8>a6||!a9){a9=C.create(document,a5);if(aZ==a4){C.insertBefore(a9,a2)}else{aZ.appendChild(a9)}ba[a5][a8]=a9}if(a1!=a5){for(var a3 in ba){for(var a0 in ba[a3]){if(s.contains(a9,ba[a3][a0])){delete ba[a3][a0]}}}}C.remove(a2.firstChild);aZ=C.create(document,"li",{innerHTML:a2.innerHTML});a9.appendChild(aZ);C.remove(a2);a6=a8;a1=a5}return a4.innerHTML}this.clean=function(a0){for(var aZ=0,a1=aW.length;aZ<a1;aZ+=2){a0=a0.replace(aW[aZ],aW[aZ+1])}a0=aY(a0);a0=a0.replace(/\s+class="?[^"\s>]*"?/ig,"");return a0}}function i(aW){function aX(a0){var aY=0;for(var aZ=a0.parentNode.firstChild;aZ;aZ=aZ.nextSibling){if(aZ!=a0&&aZ.className!="t-marker"&&aZ.nodeType==1){aY++}}return aY}this.findSuitable=function(aZ,aY){if(!aY&&aX(aZ)>0){return null}return C.parentOfType(aZ,aW[0].tags)};this.findFormat=function(a2){for(var aY=0;aY<aW.length;aY++){var a0=a2;var aZ=aW[aY].tags;var a1=aW[aY].attr;if(a0&&C.ofType(a0,aZ)&&A(a0,a1)){return a0}while(a0){a0=C.parentOfType(a0,aZ);if(a0&&A(a0,a1)){return a0}}}return null};this.isFormatted=function(aY){for(var aZ=0;aZ<aY.length;aZ++){if(this.findFormat(aY[aZ])){return true}}return false}}function b(aY,a0){this.finder=new i(aY);var aZ=s.extend({},aY[0].attr,a0);var aW=aY[0].tags[0];function aX(a1){return C.wrap(a1,C.create(a1.ownerDocument,aW,aZ))}this.activate=function(a2,a1){if(this.finder.isFormatted(a1)){this.split(a2);this.remove(a1)}else{this.apply(a1)}};this.toggle=function(a3){var a4=j(a3);var a2=a4.length==0;var a6;if(a2){var a5=aC(a3);a6=a5[1];var a1=this.editor.document.createTextNode("\ufeff");C.insertBefore(a1,a6);a4.push(a1);a1=a1.cloneNode(true);C.insertAfter(a1,a6);a4.push(a1);a3.setEndAfter(a5[2])}this.activate(a3,a4);if(a2){this.editor.pendingFormats.push(a6.parentNode)}};this.apply=function(a4){var a3=[];for(var a1=0,a2=a4.length;a1<a2;a1++){var a6=a4[a1];var a5=this.finder.findSuitable(a6);if(a5){C.attr(a5,aZ)}else{a5=aX(a6)}a3.push(a5)}this.consolidate(a3)};this.remove=function(a4){for(var a1=0,a3=a4.length;a1<a3;a1++){var a2=this.finder.findFormat(a4[a1]);if(a2){C.unwrap(a2)}}};this.split=function(a4){var a5=j(a4);var a2=a5.length==0;var a6;if(a2){a6=aC(a4)[1];a5.push(a6)}for(var a1=0,a3=a5.length;a1<a3;a1++){var a7=this.finder.findFormat(a5[a1]);if(a7){aj(a4,a7,true)}}};this.consolidate=function(a3){while(a3.length>1){var a1=a3.pop();var a2=a3[a3.length-1];if(a1.previousSibling&&a1.previousSibling.className=="t-marker"){a2.appendChild(a1.previousSibling)}if(a1.previousSibling==a2&&a1.style.cssText==a2.style.cssText){while(a1.firstChild){a2.appendChild(a1.firstChild)}C.remove(a1)}}}}function aV(aX,aW){i.call(this,aX);function aY(a2){var bd=a2.attributes,ba=s.trim;for(var a1=0,a8=bd.length;a1<a8;a1++){var a7=bd[a1];var a3=a7.nodeName;var a9=a7.nodeValue;if(a7.specified&&a3=="style"){var a4=ba(a9||a2.style.cssText).split(";");for(var bb=0,a5=a4.length;bb<a5;bb++){var be=a4[bb];if(be.length){var a6=be.split(":");var bc=ba(a6[0].toLowerCase()),a0=ba(a6[1]);if(bc!=aW){continue}return bc.indexOf("color")>=0?C.toHex(a0):a0}}}}return}function aZ(a4){var a5=s(ac(a4)?a4.parentNode:a4);var a3=a5.parents().andSelf();for(var a1=0,a2=a3.length;a1<a2;a1++){var a0=aW=="className"?a3[a1].className:aY(a3[a1]);if(a0){return a0}}return"inherit"}this.getFormat=function(a3){var a0=aZ(a3[0]);for(var a2=1,a1=a3.length;a2<a1;a2++){if(a0!=aZ(a3[a2])){return""}}return a0};this.isFormatted=function(a0){return this.getFormat(a0)!==""}}function E(aX,aY,aW){b.call(this,aX,aY);this.finder=new aV(aX,aW);this.activate=function(a0,a1){this.split(a0);if(aW){var aZ=aW.replace(/-([a-z])/,function(a2,a3){return a3.toUpperCase()});this[aY.style[aZ]=="inherit"?"remove":"apply"](a1)}else{this.apply(a1)}}}function W(aW){af.call(this,s.extend(aW,{finder:new i(aW.format),formatter:function(){return new b(aW.format)}}))}function aA(aX){V.call(this,aX);var aW=new aV([{tags:["span"]}],aX.cssAttr);this.command=function(aY){return new aF(s.extend(aY,{formatter:function(){var aZ={};aZ[aX.domAttr]=aY.value;return new E([{tags:["span"]}],{style:aZ},aX.cssAttr)}}))};this.update=function(aY,a0){var aZ=aY.data("tComboBox");aZ.close();aZ.value(aW.getFormat(a0))};this.init=function(a0,aY){var aZ=aY.editor;a0.tComboBox({data:aZ[aX.name],onChange:function(a1){V.exec(aZ,aX.name,a1.value)},highlightFirst:false});a0.data("tComboBox").dropDown.onItemCreate=function(a1){a1.html='<span unselectable="on" style="'+aX.cssAttr+": "+a1.dataItem.Value+'">'+a1.dataItem.Text+"</span>"}}}function aT(aX){V.call(this,aX);var aW=new aV([{tags:["span"]}],aX.cssAttr);this.update=function(aY){aY.data("tColorPicker").close()};this.command=function(aY){return new aF(s.extend(aY,{formatter:function(){var aZ={};aZ[aX.domAttr]=aY.value;return new E([{tags:["span"]}],{style:aZ},aX.cssAttr)}}))};this.init=function(a0,aY){var aZ=aY.editor;a0.tColorPicker({selectedColor:"#000000",onChange:function(a1){V.exec(aZ,aX.name,a1.value)}})}}function Z(){V.call(this);var aW=new aV([{tags:["span"]}],"className");this.command=function(aX){return new aF(s.extend(aX,{formatter:function(){return new E([{tags:["span"]}],{className:aX.value})}}))};this.update=function(aX,aZ){var aY=aX.data("tSelectBox");aY.close();aY.value(aW.getFormat(aZ))};this.init=function(aZ,aX){var aY=aX.editor;aZ.tSelectBox({data:aY.style,title:aY.localization.style,onItemCreate:function(a0){var a1=C.inlineStyle(aY.document,"span",{className:a0.dataItem.Value});a0.html='<span unselectable="on" style="display:block;'+a1+'">'+a0.html+"</span>"},onChange:function(a0){V.exec(aY,"style",a0.value)}})}}function x(aX){function aW(a0,a1){for(var aY=0;aY<a1.length;aY++){var aZ=a1[aY];if(aZ==null||!y(a0,aZ)){return false}}return true}this.findSuitable=function(a1){var a0=[];for(var aY=0;aY<a1.length;aY++){var aZ=C.parentOfType(a1[aY],aX[0].tags);if(!aZ){return[]}if(s.inArray(aZ,a0)<0){a0.push(aZ)}}for(var aY=0;aY<a0.length;aY++){if(aW(a0[aY],a0)){return[a0[aY]]}}return a0};this.findFormat=function(a2){for(var aY=0;aY<aX.length;aY++){var a0=a2;var aZ=aX[aY].tags;var a1=aX[aY].attr;while(a0){if(C.ofType(a0,aZ)&&A(a0,a1)){return a0}a0=a0.parentNode}}return null};this.getFormat=function(a2){var a0=s.proxy(function(a3){return this.findFormat(ac(a3)?a3.parentNode:a3)},this),aY=a0(a2[0]);if(!aY){return""}for(var a1=1,aZ=a2.length;a1<aZ;a1++){if(aY!=a0(a2[a1])){return""}}return aY.nodeName.toLowerCase()};this.isFormatted=function(aY){for(var aZ=0;aZ<aY.length;aZ++){if(!this.findFormat(aY[aZ])){return false}}return true}}function U(aX,aZ){var aY=new x(aX);function aW(a3,a7,a5){var a4=a5.length==1?C.blockParentOrBody(a5[0]):C.commonAncestor.apply(null,a5);if(C.isInline(a4)){a4=C.blockParentOrBody(a4)}var a6=C.significantChildNodes(a4);var a2=p(a6[0]);var a8=C.create(a4.ownerDocument,a3,a7);for(var a0=0;a0<a6.length;a0++){var a1=a6[a0];if(C.isBlock(a1)){C.attr(a1,a7);if(a8.childNodes.length){C.insertBefore(a8,a1);a8=a8.cloneNode(false)}a2=p(a1)+1;continue}a8.appendChild(a1)}if(a8.firstChild){C.insertAt(a4,a8,a2)}}this.apply=function(a4){var a2=C.is(a4[0],"img")?[a4[0]]:aY.findSuitable(a4);var a3=a2.length?ab(C.name(a2[0]),aX):aX[0];var a0=a3.tags[0];var a5=s.extend({},a3.attr,aZ);if(a2.length){for(var a1=0;a1<a2.length;a1++){C.attr(a2[a1],a5)}}else{aW(a0,a5,a4)}};this.remove=function(a3){for(var a0=0,a2=a3.length;a0<a2;a0++){var a1=aY.findFormat(a3[a0]);if(a1){if(C.ofType(a1,["p","img","li"])){C.unstyle(a1,ab(C.name(a1),aX).attr.style)}else{C.unwrap(a1)}}}};this.toggle=function(a1){var a0=S.nodes(a1);if(aY.isFormatted(a0)){this.remove(a0)}else{this.apply(a0)}}}function aq(aW,aY){var aX=new x(aW);this.apply=function(a4){var a0=X(a4);var a5=aW[0].tags[0];if(a0.length){for(var aZ=0,a3=a0.length;aZ<a3;aZ++){if(C.is(a0[aZ],"li")){var a6=a0[aZ].parentNode;var a1=new I(a6.nodeName.toLowerCase(),a5);var a2=this.editor.createRange();a2.selectNode(a0[aZ]);a1.toggle(a2)}else{C.changeTag(a0[aZ],a5)}}}else{new U(aW,aY).apply(a4)}};this.toggle=function(a0){var aZ=j(a0);if(!aZ.length){a0.selectNodeContents(a0.commonAncestorContainer);aZ=j(a0);if(!aZ.length){aZ=C.significantChildNodes(a0.commonAncestorContainer)}}this.apply(aZ)}}function aF(aW){aW.formatter=aW.formatter();c.call(this,aW)}function N(aW){af.call(this,s.extend(aW,{finder:new x(aW.format),formatter:function(){return new U(aW.format)}}))}function n(){V.call(this);var aW=new x([{tags:G}]);this.command=function(aX){return new aF(s.extend(aX,{formatter:function(){return new aq([{tags:[aX.value]}],{})}}))};this.update=function(aX,aZ){var aY=aX.data("tSelectBox");aY.close();aY.value(aW.getFormat(aZ))};this.init=function(aZ,aX){var aY=aX.editor;aZ.tSelectBox({data:aY.formatBlock,title:aY.localization.formatBlock,onItemCreate:function(a1){var a0=a1.dataItem.Value;a1.html="<"+a0+' unselectable="on" style="margin: .3em 0;'+C.inlineStyle(aY.document,a0)+'">'+a1.dataItem.Text+"</"+a0+">"},onChange:function(a0){V.exec(aY,"formatBlock",a0.value)},highlightFirst:false})}}function aN(aW){c.call(this,aW);this.exec=function(){var aZ=this.getRange();var a7=q(aZ);var a5=s.browser.msie?"":'<br _moz_dirty="" />';var a8=C.parentOfType(aZ.startContainer,["p"]),aX=C.parentOfType(aZ.endContainer,["p"]),aY=(a8&&!aX)||(!a8&&aX);aZ.deleteContents();var a6=C.create(a7,"a");aZ.insertNode(a6);var a0=C.parentOfType(a6,"li".split(","));var a1;if(a0){var a3=aZ.cloneRange();a3.selectNode(a0);if(j(a3).length==0){var a9=C.create(a7,"p");if(a0.nextSibling){aj(a3,a0.parentNode)}C.insertAfter(a9,a0.parentNode);C.remove(a0.parentNode.childNodes.length==1?a0.parentNode:a0);a9.innerHTML=a5;a1=a9}}if(!a1){if(!a0){new U([{tags:["p"]}]).apply([a6])}aZ.selectNode(a6);var a2=C.parentOfType(a6,[a0?"li":"p"]);aj(aZ,a2,aY);var a4=a2.previousSibling;if(C.is(a4,"li")&&a4.firstChild&&!C.is(a4.firstChild,"br")){a4=a4.firstChild}a1=a2.nextSibling;if(C.is(a1,"li")&&a1.firstChild&&!C.is(a1.firstChild,"br")){a1=a1.firstChild}C.remove(a2);if(a4.firstChild&&C.is(a4.firstChild,"br")){C.remove(a4.firstChild)}if(ac(a4)&&a4.nodeValue==""){a4=a4.parentNode}if(a4&&a4.innerHTML==""){a4.innerHTML=a5}if(a1.firstChild&&C.is(a1.firstChild,"br")){C.remove(a1.firstChild)}if(ac(a1)&&a1.nodeValue==""){a1=a1.parentNode}if(a1.innerHTML==""){a1.innerHTML=a5}g(a4)}g(a1);aZ.selectNodeContents(a1);aZ.collapse(true);C.scrollTo(a1);M(aZ)}}function d(aW){c.call(this,aW);this.exec=function(){var aY=this.getRange();aY.deleteContents();var aX=C.create(q(aY),"br");aY.insertNode(aX);aX.parentNode.normalize();if(!s.browser.msie&&(!aX.nextSibling||C.isWhitespace(aX.nextSibling))){var aZ=aX.cloneNode(true);aZ.setAttribute("_moz_dirty","");C.insertAfter(aZ,aX)}aY.setStartAfter(aX);aY.collapse(true);M(aY)}}function am(aX){var aW=[aX=="ul"?"ol":"ul",aX];x.call(this,[{tags:aW}]);this.isFormatted=function(a1){var aY=[],aZ;for(var a0=0;a0<a1.length;a0++){if((aZ=this.findFormat(a1[a0]))&&C.name(aZ)==aX&&s.inArray(aZ,aY)<0){aY.push(aZ)}}return aY.length==1};this.findSuitable=function(aY){var aZ=C.parentOfType(aY[0],aW);if(aZ&&C.name(aZ)==aX){return aZ}return null}}function I(aY,aZ){var a0=new am(aY);function aW(a4,a7){var a3=C.create(a4.ownerDocument,"li");for(var a5=0;a5<a7.length;a5++){var a6=a7[a5];if(C.is(a6,"li")){a4.appendChild(a6);continue}a3.appendChild(a6);if(C.isBlock(a6)){a4.appendChild(a3);C.unwrap(a6);a3=a3.cloneNode(false)}}if(a3.firstChild){a4.appendChild(a3)}}function a1(a3,a5){for(var a4=0;a4<a5.length;a4++){if(y(a3,a5[a4])){return true}}return false}function aX(a4,a3){return a1(a4,a3)||C.isInline(a4)||a4.nodeType==3}this.split=function(a7){var a8=j(a7);if(a8.length){var a5=C.parentOfType(a8[0],["li"]);var a3=C.parentOfType(a8[a8.length-1],["li"]);a7.setStartBefore(a5);a7.setEndAfter(a3);for(var a4=0,a6=a8.length;a4<a6;a4++){var a9=a0.findFormat(a8[a4]);if(a9){aj(a7,a9,true)}}}};this.apply=function(a7){var a6=a7.length==1?C.parentOfType(a7[0],["ul","ol"]):C.commonAncestor.apply(null,a7);if(!a6){a6=a7[0].ownerDocument.body}if(C.isInline(a6)){a6=C.blockParentOrBody(a6)}var a9=[];var a5=a0.findSuitable(a7);if(!a5){a5=new am(aY=="ul"?"ol":"ul").findSuitable(a7)}var a4=C.significantChildNodes(a6);for(var a3=0;a3<a4.length;a3++){var a8=a4[a3];var ba=C.name(a8);if(aX(a8,a7)&&(!a5||!y(a5,a8))){if(a5&&(ba=="ul"||ba=="ol")){s.each(a8.childNodes,function(){a9.push(this)});C.remove(a8)}else{a9.push(a8)}}}if(a9.length==a4.length&&a6!=a7[0].ownerDocument.body){a9=[a6]}if(!a5){a5=C.create(a6.ownerDocument,aY);C.insertBefore(a5,a9[0])}aW(a5,a9);if(!C.is(a5,aY)){C.changeTag(a5,aY)}};function a2(a3){for(var a4=a3.firstChild;a4;a4=a4.nextSibling){var a6=C.create(a3.ownerDocument,aZ||"p");while(a4.firstChild){var a5=a4.firstChild;if(C.isBlock(a5)){C.insertBefore(a5,a3)}else{a6.appendChild(a5)}}if(a6.firstChild){C.insertBefore(a6,a3)}}C.remove(a3)}this.remove=function(a6){var a4;for(var a3=0,a5=a6.length;a3<a5;a3++){if(a4=a0.findFormat(a6[a3])){a2(a4)}}};this.toggle=function(a4){var a3=j(a4);if(!a3.length){a4.selectNodeContents(a4.commonAncestorContainer);a3=j(a4);if(!a3.length){a3=C.significantChildNodes(a4.commonAncestorContainer)}}if(a0.isFormatted(a3)){this.split(a4);this.remove(a3)}else{this.apply(a3)}}}function aw(aW){aW.formatter=new I(aW.tag);c.call(this,aW)}function aI(aW){af.call(this,s.extend(aW,{finder:new am(aW.tag)}));this.command=function(aX){return new aw(s.extend(aX,{tag:aW.tag}))}}function H(){this.findSuitable=function(aW){return C.parentOfType(aW,["a"])}}function aS(){this.finder=new H();this.apply=function(aW,a2){var aY=j(aW);if(a2.innerHTML!=undefined){var aZ=aC(aW);var aX=q(aW);aW.deleteContents();var a0=C.create(aX,"a",a2);aW.insertNode(a0);if(aZ.length>1){C.insertAfter(aZ[aZ.length-1],a0);C.insertAfter(aZ[1],a0);C[aY.length>0?"insertBefore":"insertAfter"](aZ[0],a0)}}else{var a1=new b([{tags:["a"]}],a2);a1.finder=this.finder;a1.apply(aY)}}}function al(aW){aW.formatter={toggle:function(aX){new b([{tags:["a"]}]).remove(j(aX))}};c.call(this,aW)}function Y(aX){c.call(this,aX);var aW;this.async=true;var aY=new aS();this.exec=function(){var a3=this.getRange();var a1=a3.collapsed;a3=this.lockRange(true);var a6=j(a3);var a5=null;var a0=this;function a7(bd){var bc=s("#t-editor-link-url",a4.element).val();if(bc&&bc!="http://"){aW={href:bc};var a9=s("#t-editor-link-title",a4.element).val();if(a9){aW.title=a9}var ba=s("#t-editor-link-text",a4.element).val();if(ba!==a5){aW.innerHTML=ba}var bb=s("#t-editor-link-target",a4.element).val();if(bb!="false"){aW.target="_blank"}aY.apply(a3,aW)}a2(bd);if(a0.change){a0.change()}}function a2(a9){a9.preventDefault();a4.destroy();ax(q(a3)).focus();a0.releaseRange(a3)}var a8=a6.length?aY.finder.findSuitable(a6[0]):null;var aZ=a6.length<=1||(a6.length==2&&a1);var a4=ao.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>',aZ).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 t-state-default">Insert</button>').cat("&nbsp;or&nbsp;").cat('<a href="#" class="t-dialog-close t-link">Close</a>').cat("</div>").cat("</div>").string(),onClose:a2})).hide().find(".t-dialog-insert").click(a7).end().find(".t-dialog-close").click(a2).end().find(".t-form-text-row input").keydown(function(a9){if(a9.keyCode==13){a7(a9)}else{if(a9.keyCode==27){a2(a9)}}}).end().delegate(".t-button","mouseenter",ao.buttonHover).delegate(".t-button","mouseleave",ao.buttonLeave).find("#t-editor-link-url").val(a8?a8.getAttribute("href",2):"http://").end().find("#t-editor-link-text").val(a6.length>0?(a6.length==1?a6[0].nodeValue:a6[0].nodeValue+a6[1].nodeValue):"").end().find("#t-editor-link-title").val(a8?a8.title:"").end().find("#t-editor-link-target").val(a8?a8.target=="_blank":"false").end().show().data("tWindow").center();if(aZ&&a6.length>0){a5=s("#t-editor-link-text",a4.element).val()}s("#t-editor-link-url",a4.element).focus().select()},this.redo=function(){var aZ=this.lockRange(true);aY.apply(aZ,aW);this.releaseRange(aZ)}}function aO(aX){V.call(this,s.extend(aX,{command:al}));var aW=new H();this.init=function(aY){aY.attr("unselectable","on").addClass("t-state-disabled")};this.update=function(aY,aZ){aY.toggleClass("t-state-disabled",!aW.findSuitable(aZ[0])).removeClass("t-state-hover")}}function aJ(aX){c.call(this,aX);this.async=true;var aW;function aY(aZ,a0){if(aW.src&&aW.src!="http://"){if(!aZ){aZ=C.create(q(a0),"img",aW);aZ.onload=aZ.onerror=function(){aZ.removeAttribute("complete");aZ.removeAttribute("width");aZ.removeAttribute("height")};a0.deleteContents();a0.insertNode(aZ);a0.setStartAfter(aZ);a0.setEndAfter(aZ);M(a0);return true}else{C.attr(aZ,aW)}}return false}this.redo=function(){var aZ=this.lockRange();if(!aY(S.image(aZ),aZ)){this.releaseRange(aZ)}};this.exec=function(){var a2=this.lockRange();var aZ=false;var a4=S.image(a2);var a0=this;function a5(a6){aW={src:s("#t-editor-image-url",a3.element).val(),alt:s("#t-editor-image-title",a3.element).val()};aZ=aY(a4,a2);a1(a6);if(a0.change){a0.change()}}function a1(a6){a6.preventDefault();a3.destroy();ax(q(a2)).focus();if(!aZ){a0.releaseRange(a2)}}var a3=ao.window.create(s.extend({},this.editor.dialogOptions,{title:"Insert image",html:new s.telerik.stringBuilder().cat('<div class="t-editor-dialog">').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 t-state-default">Insert</button>').cat("&nbsp;or&nbsp;").cat('<a href="#" class="t-dialog-close t-link">Close</a>').cat("</div>").cat("</div>").string(),onClose:a1})).hide().find(".t-dialog-insert").click(a5).end().find(".t-dialog-close").click(a1).end().find(".t-form-text-row input").keydown(function(a6){if(a6.keyCode==13){a5(a6)}else{if(a6.keyCode==27){a1(a6)}}}).end().delegate(".t-button","mouseenter",ao.buttonHover).delegate(".t-button","mouseleave",ao.buttonLeave).find("#t-editor-image-url").val(a4?a4.getAttribute("src",2):"http://").end().find("#t-editor-image-title").val(a4?a4.alt:"").end().show().data("tWindow").center();s("#t-editor-image-url",a3.element).focus().select()}}ao.selectbox=function(aW,aX){var a4;var aZ=s(aW);var a1=aZ.find(".t-input");var aY=new ao.dropDown({outerHeight:aZ.outerHeight(),outerWidth:aZ.outerWidth(),zIndex:ao.list.getZIndex(aZ),effects:ao.fx.slide.defaults(),onOpen:function(){var a5=aZ.offset();aY.position(a5.top,a5.left);return true},onItemCreate:aX.onItemCreate,onClick:function(a5){a3(aX.data[s(a5.item).index()].Value);aX.onChange({value:a4})}});function a0(){if(!aY.$items){aY.dataBind(aX.data)}}function a2(a5){a1.html(a5)}function a3(a7){a0();var a6=-1;for(var a5=0,a8=aX.data.length;a5<a8;a5++){if(aX.data[a5].Value==a7){a6=a5;break}}if(a6!=-1){aY.$items.removeClass("t-state-selected").eq(a6).addClass("t-state-selected");a2(s(aY.$items[a6]).text());a4=aX.data[a6].Value}}this.value=function(a5){a3(a5);if(a4!=a5){a2(aX.title)}};this.close=function(){aY.close()};a2(aX.title);aZ.bind({click:function(a5){a0();if(aY.isOpened()){aY.close()}else{aY.open()}}});s(document).bind("mousedown",s.proxy(function(a7){var a5=aY.$element;var a6=a5&&a5.parent().length>0;if(a6&&!s.contains(aW,a7.target)&&!s.contains(a5.parent()[0],a7.target)){aY.close()}},this))};s.fn.tSelectBox=function(aW){return ao.create(this,{name:"tSelectBox",init:function(aX,aY){return new ao.selectbox(aX,aY)},options:aW})};s.fn.tSelectBox.defaults={effects:s.fn.tDropDownList.defaults.effects};ao.colorpicker=function(aW,aX){this.element=aW;var aY=s(aW);s.extend(this,aX);aY.bind("click",s.proxy(this.click,this));if(this.selectedColor){aY.find(".t-selected-color").css("background-color",this.selectedColor)}s(aW.ownerDocument).bind("mousedown",s.proxy(function(aZ){if(!s(aZ.target).closest(".t-colorpicker-popup").length){this.close()}},this));ao.bind(this,{change:this.onChange,load:this.onLoad})};ao.colorpicker.prototype={select:function(aW){if(aW){aW=C.toHex(aW);if(!ao.trigger(this.element,"change",{value:aW})){this.value(aW);this.close()}}else{ao.trigger(this.element,"change",{value:this.selectedColor})}},open:function(){var aW=this.popup();var aZ=s(this.element);var aY=aZ.offset();aY.top+=aZ.outerHeight();var aX="auto";aZ.parents().andSelf().each(function(){aX=s(this).css("zIndex");if(Number(aX)){aX=Number(aX)+1;return false}});ao.fx._wrap(aW).css(s.extend({position:"absolute",zIndex:aX},aY));aW.find(".t-item").bind("click",s.proxy(function(a1){var a0=s(a1.target,a1.target.ownerDocument).css("background-color");this.select(a0)},this));ao.fx.play(this.effects,aW,{direction:"bottom"})},close:function(){if(!this.$popup){return}ao.fx.rewind(this.effects,this.$popup,{direction:"bottom"},s.proxy(function(){C.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(aW){if(s(aW.target).closest(".t-tool-icon").length>0){this.select()}else{this.toggle()}},value:function(aW){if(!aW){return this.selectedColor}aW=C.toHex(aW);this.selectedColor=aW;s(".t-selected-color",this.element).css("background-color",aW)},popup:function(){if(!this.$popup){this.$popup=s(ao.colorpicker.buildPopup(this)).hide().appendTo(document.body)}return this.$popup}};s.extend(ao.colorpicker,{buildPopup:function(aW){var aZ=new ao.stringBuilder();aZ.cat('<div class="t-popup t-group t-colorpicker-popup">').cat('<ul class="t-reset">');var a1=aW.data;var aY=(aW.value()||"").substring(1);for(var aX=0,a0=a1.length;aX<a0;aX++){aZ.cat('<li class="t-item').catIf(" t-selected",a1[aX]==aY).cat('" style="background-color:#').cat(a1[aX]).cat('"></li>')}aZ.cat("</ul></div>");return aZ.string()}});s.fn.tColorPicker=function(aW){return ao.create(this,{name:"tColorPicker",init:function(aX,aY){return new ao.colorpicker(aX,aY)},options:aW})};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:s.fn.tDropDownList.defaults.effects};function aQ(){var aX=new x([{tags:G}]);function aW(aY){return aY.style.marginLeft||0}this.apply=function(a3){var a1=aX.findSuitable(a3);if(a1.length){var a0=[];for(var aZ=0;aZ<a1.length;aZ++){if(C.is(a1[aZ],"li")){if(s(a1[aZ]).index()==0){a0.push(a1[aZ].parentNode)}else{if(s.inArray(a1[aZ].parentNode,a0)<0){a0.push(a1[aZ])}}}else{a0.push(a1[aZ])}}while(a0.length){var a4=a0.shift();if(C.is(a4,"li")){var a7=a4.parentNode;var a2=s(a4).prev("li");var a6=a2.find(">ul")[0];if(!a6){a6=C.create(a4.ownerDocument,C.name(a7));a2.append(a6)}while(a4&&a4.parentNode==a7){a6.appendChild(a4);a4=a0.shift()}}else{var aY=parseInt(aW(a4))+30;C.style(a4,{marginLeft:aY})}}}else{var a5=new U([{tags:G}],{style:{marginLeft:30}});a5.apply(a3)}};this.remove=function(a0){var a2=aX.findSuitable(a0);for(var aY=0;aY<a2.length;aY++){var aZ=s(a2[aY]);if(aZ.is("li")){var a5=aZ.parent();var a1=a5.parent();if(a1.is("li")&&!aW(a5[0])){var a4=aZ.nextAll("li");if(a4.length){s(a5[0].cloneNode(false)).appendTo(aZ).append(a4)}aZ.insertAfter(a1);if(!a5.children("li").length){a5.remove()}continue}else{aZ=a5}}var a3=parseInt(aW(aZ[0]))-30;C[a3<=0?"unstyle":"style"](aZ[0],{marginLeft:a3})}}}function o(aW){aW.formatter={toggle:function(aX){new aQ().apply(S.nodes(aX))}};c.call(this,aW)}function Q(aW){aW.formatter={toggle:function(aX){new aQ().remove(S.nodes(aX))}};c.call(this,aW)}function ad(){V.call(this,{command:Q});var aW=new x([{tags:G}]);this.init=function(aX){aX.attr("unselectable","on").addClass("t-state-disabled")};this.update=function(aY,a0){var aZ=aW.findSuitable(a0);for(var aX=0;aX<aZ.length;aX++){if(C.is(aZ[aX],"li")||aZ[aX].style.marginLeft){aY.removeClass("t-state-disabled");return}}aY.addClass("t-state-disabled").removeClass("t-state-hover")}}function av(aW,a1){aW.hide();var a0=s("<iframe />",{src:'javascript:"<html></html>"',frameBorder:"0",className:"t-content"}).css("display","").insertBefore(aW)[0];var aX=a0.contentWindow||a0;var aZ=aX.document||a0.contentDocument;var aY=aW.val().replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/ig,"$1");aZ.designMode="On";aZ.open();aZ.write(new ao.stringBuilder().cat('<!DOCTYPE><html><head xmlns="http://www.w3.org/1999/xhtml">').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.5em;padding-top:1px;margin-top:-1px;}").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:1em 0;padding:0 .2em}.t-marker{display:none;}").cat("ul,ol{padding-left:2.5em}").cat("a{color:#00a}").cat("code{font-size:1.23em}").cat("</style>").cat(s.map(a1,function(a2){return['<link type="text/css" href="',a2,'" rel="stylesheet"/>'].join("")}).join("")).cat('</head><body spellcheck="false">').cat(aY).cat("</body></html>").string());aZ.close();return aX}function T(aW){ao.trigger(aW.element,"selectionChange")}function au(aW){if(aW.pendingFormats.length==0){return}aW.pendingFormats.reverse();s.each(aW.pendingFormats,function(){for(var aX=this.firstChild;aX;aX=aX.nextSibling){while(aX.nodeType==3&&(charIndex=aX.nodeValue.indexOf("\ufeff"))>=0){aX.deleteData(charIndex,1)}}});s.each(aW.pendingFormats,function(){if(this.innerHTML==""&&this.parentNode){C.remove(this)}});aW.pendingFormats=[]}ao.editor=function(aW,aX){if(/Mobile.*Safari/.test(navigator.userAgent)){return}var aY=this;this.element=aW;var aZ=s(aW);aZ.closest("form").bind("submit",function(){aY.update()});s.extend(this,aX);ao.bind(this,{load:this.onLoad,selectionChange:this.onSelectionChange,change:this.onChange,execute:this.onExecute});this.textarea=aZ.find("textarea").attr("autocomplete","off")[0];this.window=av(s(this.textarea),this.stylesheets);this.document=this.window.contentDocument||this.window.document;this.body=this.document.body;this.keyboard=new aE([new aK(this),new z(this)]);this.clipboard=new ay(this);this.pendingFormats=[];this.undoRedoStack=new P();function a3(a4){var a5=s.grep(a4.className.split(" "),function(a6){return !/^t-(widget|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(a6)});return a5[0]?a5[0].substring(2):"custom"}function a2(a5,a4){if(!a4.key){return a5}return new ao.stringBuilder().cat(a5).cat(" (").catIf("Ctrl + ",a4.ctrl).catIf("Shift + ",a4.shift).catIf("Alt + ",a4.alt).cat(a4.key).cat(")").string()}s(this.window).bind("blur",function(){var a4=aY.textarea.value;var a5=aY.encodedValue();aY.update(a5);if(a5!=a4){ao.trigger(aY.element,"change")}});var a1=".t-editor-toolbar > li > *";var a0=".t-editor-button .t-tool-icon:not(.t-state-disabled)";aZ.delegate(a0,"mouseenter",ao.hover).delegate(a0,"mouseleave",ao.leave).delegate(a0,"mousedown",ao.preventDefault).delegate(a0,"click",ao.stopAll(function(a4){aY.focus();aY.exec(a3(this))})).find(a1).each(function(){var a6=a3(this);var a4=aY.tools[a6];if(!a4){return}var a5=a2(aY.localization[a6],a4);a4.init(s(this),{title:a5,editor:aY})}).end().bind("selectionChange",function(){var a5=aY.getRange();aY.selectionRestorePoint=new ak(a5);var a4=j(a5);if(!a4.length){a4=[a5.startContainer]}aZ.find(a1).each(function(){var a6=aY.tools[a3(this)];if(a6){a6.update(s(this),a4)}})});s(this.document).bind("keyup",function(a4){var a5=[8,9,13,33,34,35,36,37,38,39,40,40,45,46];if(s.inArray(a4.keyCode,a5)>-1){T(aY)}}).keydown(function(a5){var a4=aY.keyboard.toolFromShortcut(aY.tools,a5);if(a4){a5.preventDefault();aY.exec(a4);return false}aY.keyboard.clearTimeout();aY.keyboard.keydown(a5)}).keyup(function(a4){aY.keyboard.keyup(a4)}).mouseup(function(){T(aY)});s(this.body).bind("cut paste",function(a4){aY.clipboard["on"+a4.type](a4)})};s.extend(ao.editor,{Dom:C,RestorePoint:ak,Marker:aa,RangeUtils:S,RangeEnumerator:ag,LinkFormatter:aS,LinkFormatFinder:H,LinkCommand:Y,UnlinkCommand:al,InlineFormatter:b,GreedyInlineFormatter:E,InlineFormatFinder:i,GreedyInlineFormatFinder:aV,BlockFormatter:U,GreedyBlockFormatter:aq,BlockFormatFinder:x,FormatCommand:aF,IndentFormatter:aQ,IndentCommand:o,OutdentCommand:Q,ListFormatFinder:am,ListFormatter:I,ListCommand:aw,ParagraphCommand:aN,NewLineCommand:d,ImageCommand:aJ,InsertHtmlCommand:aM,GenericCommand:aR,UndoRedoStack:P,TypingHandler:aK,SystemHandler:z,Keyboard:aE,MSWordFormatCleaner:f});ao.editor.prototype={value:function(aW){if(aW===undefined){return B(this.body)}aW=aW.replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->");aW=aW.replace(/<script([^>]*)>(.*)?<\/script>/ig,"<telerik:script $1>$2</telerik:script>");if(s.browser.msie){aW="<br/>"+aW;aW=aW.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,'originalhref="$1"');aW=aW.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,'originalsrc="$1"');this.body.innerHTML=aW;C.remove(this.body.firstChild);s("script,link,img,a",this.body).each(function(){if(this["originalhref"]){this.setAttribute("href",this["originalhref"]);this.removeAttribute("originalhref")}if(this["originalsrc"]){this.setAttribute("src",this["originalsrc"]);this.removeAttribute("originalsrc")}})}else{this.body.innerHTML=aW}this.update()},focus:function(){this.window.focus()},update:function(aW){this.textarea.value=aW||this.encoded?this.encodedValue():this.value()},encodedValue:function(){return C.encode(this.value())},createRange:function(aW){return aL(aW||this.document)},getSelection:function(){return aU(this.document)},selectRange:function(aX){var aW=this.getSelection();aW.removeAllRanges();aW.addRange(aX)},getRange:function(){var aW=this.getSelection();return aW.rangeCount>0?aW.getRangeAt(0):this.createRange()},selectedHtml:function(){return B(this.getRange().cloneContents())},paste:function(aW){this.clipboard.paste(aW)},exec:function(aZ,aW){aZ=aZ.toLowerCase();var a1="";for(var aY in this.tools){if(aY.toLowerCase()==aZ){a1=this.tools[aY];break}}if(a1){var aX=this.getRange();var a0=a1.command?a1.command(s.extend({range:aX},aW)):null;ao.trigger(this.element,"execute",{name:aZ,command:a0});if(/undo|redo/i.test(aZ)){this.undoRedoStack[aZ]()}else{if(a0){if(!a0.managesUndoRedo){this.undoRedoStack.push(a0)}a0.editor=this;a0.exec();if(a0.async){a0.change=s.proxy(function(){T(this)},this);return}}}T(this)}}};s.fn.tEditor=function(aW){return ao.create(this,{name:"tEditor",init:function(aX,aY){return new ao.editor(aX,aY)},options:aW})};var ah={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:G,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left"}}}],justifyCenter:[{tags:G,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto"}}}],justifyRight:[{tags:G,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right"}}}],justifyFull:[{tags:G,attr:{style:{textAlign:"justify"}}}]};function ab(aY,aX){for(var aW=0;aW<aX.length;aW++){if(s.inArray(aY,aX[aW].tags)>=0){return aX[aW]}}}function V(aW){s.extend(this,aW);this.init=function(aX,aY){aX.attr({unselectable:"on",title:aY.title})};this.command=function(aX){return new aW.command(aX)};this.update=function(){}}V.exec=function(aX,aY,aW){aX.focus();if(aX.selectionRestorePoint){aX.selectRange(aX.selectionRestorePoint.toRange())}aX.exec(aY,{value:aW})};function af(aW){V.call(this,aW);this.command=function(aX){return new aF(s.extend(aX,{formatter:aW.formatter}))};this.update=function(aX,aY){aX.toggleClass("t-state-active",aW.finder.isFormatted(aY))}}var O=function(){return{isFormatted:function(){return false}}};s.fn.tEditor.defaults={localization:{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",fontSize:"Select font size",formatBlock:"Format",style:"Styles"},formats:ah,encoded:true,stylesheets:[],dialogOptions:{modal:true,resizable:false,draggable:true,effects:{list:[{name:"toggle"}]}},fontName:[{Text:"inherit",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:"inherit",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 W({key:"B",ctrl:true,format:ah.bold}),italic:new W({key:"I",ctrl:true,format:ah.italic}),underline:new W({key:"U",ctrl:true,format:ah.underline}),strikethrough:new W({format:ah.strikethrough}),undo:{key:"Z",ctrl:true},redo:{key:"Y",ctrl:true},insertLineBreak:new V({key:13,shift:true,command:d}),insertParagraph:new V({key:13,command:aN}),justifyCenter:new N({format:ah.justifyCenter}),justifyLeft:new N({format:ah.justifyLeft}),justifyRight:new N({format:ah.justifyRight}),justifyFull:new N({format:ah.justifyFull}),insertUnorderedList:new aI({tag:"ul"}),insertOrderedList:new aI({tag:"ol"}),createLink:new V({key:"K",ctrl:true,command:Y}),unlink:new aO({key:"K",ctrl:true,shift:true}),insertImage:new V({command:aJ}),indent:new V({command:o}),outdent:new ad(),insertHtml:new w(),style:new Z(),fontName:new aA({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName"}),fontSize:new aA({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize"}),formatBlock:new n(),foreColor:new aT({cssAttr:"color",domAttr:"color",name:"foreColor"}),backColor:new aT({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor"})}}})(jQuery);