1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-26 09:49:00 +00:00
Radarr/NzbDrone.Web/Scripts/2011.1.315/telerik.editor.min.js
2011-03-28 21:52:17 -07:00

1 line
No EOL
68 KiB
JavaScript

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