1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-14 15:03:42 +01:00
Radarr/NzbDrone.Web/Scripts/2011.2.712/telerik.editor.min.js
Mark McDowall 8d0cdf272c Moved away from CDNs for 3rd party scripts.
Added Telerik MVC Controls, JQuery, JQueryUI and YUI.
2011-09-07 19:48:37 -07:00

1 line
69 KiB
JavaScript

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