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.
Lidarr/NzbDrone.Web/Scripts/2010.3.1318/telerik.editor.min.js

1 line
67 KiB

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