(function(s){var ar=s.telerik;function G(a3){var a2={};for(var a1=0;a18){g=function(a2){if(a2.nodeType==1&&a2.firstChild){var a1=a2.firstChild,a3=a1;while(a3=a3.nextSibling){if(a3.nodeType==3&&a1.nodeType==3){a3.nodeValue=a1.nodeValue+a3.nodeValue;D.remove(a1)}a1=a3}}}}function p(a1){var a2=0;while(a1=a1.previousSibling){a2++}return a2}function af(a1){return a1&&a1.nodeValue!==null&&a1.data!==null}function k(a1,a2){try{return !af(a1)&&(s.contains(a1,af(a2)?a2.parentNode:a2)||a2.parentNode==a1)}catch(a3){return false}}function z(a2,a1){return k(a2,a1)||a2==a1}function aB(a2,a1){if(k(a2,a1)){while(a1&&a1.parentNode!=a2){a1=a1.parentNode}}return a1}function aG(a1){return af(a1)?a1.length:a1.childNodes.length}function av(a1,a3){var a2=a1.cloneNode(false);a1.deleteData(a3,a1.length);a2.deleteData(0,a3);D.insertAfter(a2,a1)}function B(a2,a3){for(var a4 in a3){var a1=a2[a4];if(a4=="float"){a1=a2[s.support.cssFloat?"cssFloat":"styleFloat"]}if(typeof a1=="object"){if(!B(a1,a3[a4])){return false}}else{if(a1!=a3[a4]){return false}}}return true}var aD=/^\s+$/;var e=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i;var ah=("color,padding-left,padding-right,padding-top,padding-bottom,background-color,background-attachment,background-image,background-position,background-repeat,border-top-style,border-top-width,border-top-color,border-bottom-style,border-bottom-width,border-bottom-color,border-left-style,border-left-width,border-left-color,border-right-style,border-right-width,border-right-color,font-family,font-size,font-style,font-variant,font-weight,line-height").split(",");var D={blockParentOrBody:function(a1){return D.parentOfType(a1,H)||a1.ownerDocument.body},normalize:g,toHex:function(a1){var a2=e.exec(a1);if(!a2){return a1}return"#"+s.map(a2.slice(1),function(a3){return a3=parseInt(a3).toString(16),a3.length>1?a3:"0"+a3}).join("")},encode:function(a1){return a1.replace(/&/g,"&").replace(//g,">").replace(/\u00a0/g," ")},name:function(a1){return a1.nodeName.toLowerCase()},significantChildNodes:function(a1){return s.grep(a1.childNodes,function(a2){return a2.nodeType!=3||!D.isWhitespace(a2)})},lastTextNode:function(a2){if(a2.nodeType==3){return a2}var a1=null;for(var a3=a2.lastChild;a3;a3=a3.previousSibling){if(a1=D.lastTextNode(a3)){return a1}}return a1},is:function(a1,a2){return D.name(a1)==a2},isMarker:function(a1){return a1.className=="t-marker"},isWhitespace:function(a1){return aD.test(a1.nodeValue)},isBlock:function(a1){return N[D.name(a1)]},isEmpty:function(a1){return aM[D.name(a1)]},isInline:function(a1){return aU[D.name(a1)]},scrollTo:function(a1){a1.ownerDocument.body.scrollTop=s(af(a1)?a1.parentNode:a1).offset().top},insertAt:function(a2,a1,a3){a2.insertBefore(a1,a2.childNodes[a3]||null)},insertBefore:function(a1,a2){if(a2.parentNode){return a2.parentNode.insertBefore(a1,a2)}else{return a2}},insertAfter:function(a1,a2){return a2.parentNode.insertBefore(a1,a2.nextSibling)},remove:function(a1){a1.parentNode.removeChild(a1)},trim:function(a2){for(var a1=a2.childNodes.length-1;a1>=0;a1--){var a3=a2.childNodes[a1];if(af(a3)){if(a3.nodeValue.replace(/\ufeff/g,"").length==0){D.remove(a3)}if(D.isWhitespace(a3)){D.insertBefore(a3,a2)}}else{if(a3.className!="t-marker"){D.trim(a3);if(a3.childNodes.length==0&&!D.isEmpty(a3)){D.remove(a3)}}}}return a2},parentOfType:function(a1,a2){do{a1=a1.parentNode}while(a1&&!(D.ofType(a1,a2)));return a1},ofType:function(a1,a2){return s.inArray(D.name(a1),a2)>=0},changeTag:function(a5,a2){var a4=D.create(a5.ownerDocument,a2);var a8=a5.attributes;for(var a3=0;a3")},end:function(){a6.push("")}},b:{start:function(){a6.push("")},end:function(){a6.push("")}},i:{start:function(){a6.push("")},end:function(){a6.push("")}},u:{start:function(){a6.push('')},end:function(){a6.push("")}},font:{start:function(a9){a6.push('')},end:function(a7){a6.push("")}}};function a2(a8){var bf=[],bn=a8.attributes,bk=s.trim;if(D.is(a8,"img")){var bq=a8.style.width,bg=a8.style.height,be=s(a8);if(bq){be.attr("width",parseInt(bq));D.unstyle(a8,{width:undefined})}if(bg){be.attr("height",parseInt(bg));D.unstyle(a8,{height:undefined})}}for(var bd=0,bi=bn.length;bdbs.nodeName?1:br.nodeName=0){a7=D.toHex(a7)}if(a9.indexOf("font-family")>=0){a7=a7.replace(K,"'")}a6.push(a9);a6.push(":");a6.push(a7);a6.push(";")}}}else{if(bp=="src"||bp=="href"){a6.push(a8.getAttribute(bp,2))}else{a6.push(M[bp]?bp:bj)}}a6.push('"')}}function a1(a7,a8){for(var a9=a7.firstChild;a9;a9=a9.nextSibling){a4(a9,a8)}}function a4(ba,bb){var be=ba.nodeType;if(be==1){if(ba.attributes._moz_dirty&&D.is(ba,"br")){return}var a8=D.name(ba);var bc=a5[a8];if(bc){bc.start(ba);a1(ba);bc.end(ba);return}a6.push("<");a6.push(a8);a2(ba);if(aM[a8]){a6.push(" />")}else{a6.push(">");a1(ba,bb||D.is(ba,"pre"));a6.push("")}}else{if(be==3){var a7=ba.nodeValue;if(!bb&&s.support.leadingWhitespace){var bd=ba.parentNode;var a9=(D.isInline(bd)?bd:ba).previousSibling;if(!a9||a9.innerHTML==""||D.isBlock(a9)){a7=a7.replace(/^[\r\n\v\f\t ]+/,"")}a7=a7.replace(/ +/," ")}a6.push(D.encode(a7))}else{if(be==4){a6.push("")}else{if(be==8){if(ba.data.indexOf("[CDATA[")<0){a6.push("")}else{a6.push("")}}}}}}a1(a3);return a6.join("")}var v=0,aq=1,a=2,T=3;function q(a2){var a1=a2.startContainer;return a1.nodeType==9?a1:a1.ownerDocument}function E(a1){if(s.browser.msie){return new aw(a1.document)}return a1.getSelection()}function al(a2){var a1=q(a2);return aZ(a1)}function aZ(a1){return E(az(a1))}function az(a1){return a1.defaultView||a1.parentWindow}function am(a1,a2,a4){function a3(a7){var a5=a1.cloneRange();a5.collapse(a7);a5[a7?"setStartBefore":"setEndAfter"](a2);var a6=a5.extractContents();if(a4){a6=D.trim(a6)}D[a7?"insertBefore":"insertAfter"](a6,a2)}a3(true);a3(false)}function O(a2){var a3=U.image(a2);if(a3){a2.setStartAfter(a3);a2.setEndAfter(a3)}var a1=al(a2);a1.removeAllRanges();a1.addRange(a2)}function L(a1){s.extend(this,{ownerDocument:a1,startContainer:a1,endContainer:a1,commonAncestorContainer:a1,startOffset:0,endOffset:0,collapsed:true})}L.prototype={setStart:function(a1,a2){this.startContainer=a1;this.startOffset=a2;w(this);u(this,true)},setEnd:function(a1,a2){this.endContainer=a1;this.endOffset=a2;w(this);u(this,false)},setStartBefore:function(a1){this.setStart(a1.parentNode,p(a1))},setStartAfter:function(a1){this.setStart(a1.parentNode,p(a1)+1)},setEndBefore:function(a1){this.setEnd(a1.parentNode,p(a1))},setEndAfter:function(a1){this.setEnd(a1.parentNode,p(a1)+1)},selectNode:function(a1){this.setStartBefore(a1);this.setEndAfter(a1)},selectNodeContents:function(a1){this.setStart(a1,0);this.setEnd(a1,a1[a1.nodeType===1?"childNodes":"nodeValue"].length)},collapse:function(a1){if(a1){this.setEnd(this.startContainer,this.startOffset)}else{this.setStart(this.endContainer,this.endOffset)}},deleteContents:function(){var a2=this.cloneRange();if(this.startContainer!=this.commonAncestorContainer){this.setStartAfter(aB(this.commonAncestorContainer,this.startContainer))}this.collapse(true);(function a1(a3){while(a3.next()){a3.hasPartialSubtree()?a1(a3.getSubtreeIterator()):a3.remove()}})(new l(a2))},cloneContents:function(){var a1=q(this);return(function a2(a5){for(var a4,a3=a1.createDocumentFragment();a4=a5.next();){a4=a4.cloneNode(!a5.hasPartialSubtree());if(a5.hasPartialSubtree()){a4.appendChild(a2(a5.getSubtreeIterator()))}a3.appendChild(a4)}return a3})(new l(this))},extractContents:function(){var a2=this.cloneRange();if(this.startContainer!=this.commonAncestorContainer){this.setStartAfter(aB(this.commonAncestorContainer,this.startContainer))}this.collapse(true);var a3=this;var a1=q(this);return(function a4(a7){for(var a6,a5=a1.createDocumentFragment();a6=a7.next();){a7.hasPartialSubtree()?a6=a6.cloneNode(false):a7.remove(a3.originalRange);if(a7.hasPartialSubtree()){a6.appendChild(a4(a7.getSubtreeIterator()))}a5.appendChild(a6)}return a5})(new l(a2))},insertNode:function(a1){if(af(this.startContainer)){if(this.startOffset!=this.startContainer.nodeValue.length){av(this.startContainer,this.startOffset)}D.insertAfter(a1,this.startContainer)}else{D.insertAt(this.startContainer,a1,this.startOffset)}this.setStart(this.startContainer,this.startOffset)},cloneRange:function(){return s.extend(new L(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var a2=this.startContainer.nodeName,a1=this.endContainer.nodeName;return[a2=="#text"?this.startContainer.nodeValue:a2,"(",this.startOffset,") : ",a1=="#text"?this.endContainer.nodeValue:a1,"(",this.endOffset,")"].join("")}};function m(a3,a1,a8,a5){if(a3==a1){return a5-a8}var a7=a1;while(a7&&a7.parentNode!=a3){a7=a7.parentNode}if(a7){return p(a7)-a8}a7=a3;while(a7&&a7.parentNode!=a1){a7=a7.parentNode}if(a7){return a5-p(a7)-1}var a6=D.commonAncestor(a3,a1);var a4=a3;while(a4&&a4.parentNode!=a6){a4=a4.parentNode}if(!a4){a4=a6}var a2=a1;while(a2&&a2.parentNode!=a6){a2=a2.parentNode}if(!a2){a2=a6}if(a4==a2){return 0}return p(a2)-p(a4)}function u(a2,a3){function a1(a5){try{return m(a5.startContainer,a5.endContainer,a5.startOffset,a5.endOffset)<0}catch(a4){return true}}if(a1(a2)){if(a3){a2.commonAncestorContainer=a2.endContainer=a2.startContainer;a2.endOffset=a2.startOffset}else{a2.commonAncestorContainer=a2.startContainer=a2.endContainer;a2.startOffset=a2.endOffset}a2.collapsed=true}}function w(a2){a2.collapsed=a2.startContainer==a2.endContainer&&a2.startOffset==a2.endOffset;var a1=a2.startContainer;while(a1&&a1!=a2.endContainer&&!k(a1,a2.endContainer)){a1=a1.parentNode}a2.commonAncestorContainer=a1}function aQ(a1){if(s.browser.msie){return new L(a1)}return a1.createRange()}function l(a2){s.extend(this,{range:a2,_current:null,_next:null,_end:null});if(a2.collapsed){return}var a1=a2.commonAncestorContainer;this._next=a2.startContainer==a1&&!af(a2.startContainer)?a2.startContainer.childNodes[a2.startOffset]:aB(a1,a2.startContainer);this._end=a2.endContainer==a1&&!af(a2.endContainer)?a2.endContainer.childNodes[a2.endOffset]:aB(a1,a2.endContainer).nextSibling}l.prototype={hasNext:function(){return !!this._next},next:function(){var a1=this._current=this._next;this._next=this._current&&this._current.nextSibling!=this._end?this._current.nextSibling:null;if(af(this._current)){if(this.range.endContainer==this._current){(a1=a1.cloneNode(true)).deleteData(this.range.endOffset,a1.length-this.range.endOffset)}if(this.range.startContainer==this._current){(a1=a1.cloneNode(true)).deleteData(0,this.range.startOffset)}}return a1},traverse:function(a2){function a1(){this._current=this._next;this._next=this._current&&this._current.nextSibling!=this._end?this._current.nextSibling:null;return this._current}var a3;while(a3=a1.call(this)){if(this.hasPartialSubtree()){this.getSubtreeIterator().traverse(a2)}else{a2(a3)}}return a3},remove:function(a6){var a5=this.range.startContainer==this._current;var a3=this.range.endContainer==this._current;if(af(this._current)&&(a5||a3)){var a2=a5?this.range.startOffset:0;var a1=a3?this.range.endOffset:this._current.length;var a8=a1-a2;if(a6&&(a5||a3)){if(this._current==a6.startContainer&&a2<=a6.startOffset){a6.startOffset-=a8}if(this._current==a6.endContainer&&a1<=a6.endOffset){a6.endOffset-=a8}}this._current.deleteData(a2,a8)}else{var a7=this._current.parentNode;if(a6&&(this.range.startContainer==a7||this.range.endContainer==a7)){var a4=p(this._current);if(a7==a6.startContainer&&a4<=a6.startOffset){a6.startOffset-=1}if(a7==a6.endContainer&&a40&&a4.previousSibling);a7.setEndPoint(a1?"EndToStart":"EndToEnd",a6);var a5=a4.nextSibling;if(!a5){a5=a4.previousSibling;if(a5&&af(a5)){a2.setEnd(a5,a5.nodeValue.length);D.remove(a4)}else{a2.selectNodeContents(a3);D.remove(a4);a2.endOffset-=1}return}D.remove(a4);if(af(a5)){a2[a1?"setStart":"setEnd"](a5,a7.text.length)}else{a2[a1?"setStartBefore":"setEndBefore"](a5)}}function aj(a1){this.enumerate=function(){var a3=[];function a2(a4){if(D.is(a4,"img")||(a4.nodeType==3&&!D.isWhitespace(a4))){a3.push(a4)}else{a4=a4.firstChild;while(a4){a2(a4);a4=a4.nextSibling}}}new l(a1).traverse(a2);return a3}}function j(a1){return new aj(a1).enumerate()}function Z(a5){var a1=[];for(var a2=0,a4=a5.length;a2'}a3.selectNodeContents(a7)}}a3.collapse(true)};this.add=function(a2,a4){if(a4&&a2.collapsed){this.addCaret(a2);a2=U.expand(a2)}var a3=a2.cloneRange();a3.collapse(false);this.end=D.create(q(a2),"span",{className:"t-marker"});a3.insertNode(this.end);a3=a2.cloneRange();a3.collapse(true);this.start=this.end.cloneNode(true);a3.insertNode(this.start);a2.setStartBefore(this.start);a2.setEndAfter(this.end);g(a2.commonAncestorContainer);return a2};this.remove=function(a9){var a2=this.start,be=this.end;g(a9.commonAncestorContainer);while(!a2.nextSibling&&a2.parentNode){a2=a2.parentNode}while(!be.previousSibling&&be.parentNode){be=be.parentNode}var a4=(a2.previousSibling&&a2.previousSibling.nodeType==3)&&(a2.nextSibling&&a2.nextSibling.nodeType==3);var ba=(be.previousSibling&&be.previousSibling.nodeType==3)&&(be.nextSibling&&be.nextSibling.nodeType==3);a2=a2.nextSibling;be=be.previousSibling;var bd=false;var a7=false;if(a2==this.end){a7=!!this.start.previousSibling;a2=be=this.start.previousSibling||this.end.nextSibling;bd=true}D.remove(this.start);D.remove(this.end);if(a2==null||be==null){a9.selectNodeContents(a9.commonAncestorContainer);a9.collapse(true);return}var bc=bd?af(a2)?a2.nodeValue.length:a2.childNodes.length:0;var a5=af(be)?be.nodeValue.length:be.childNodes.length;if(a2.nodeType==3){while(a2.previousSibling&&a2.previousSibling.nodeType==3){a2=a2.previousSibling;bc+=a2.nodeValue.length}}if(be.nodeType==3){while(be.previousSibling&&be.previousSibling.nodeType==3){be=be.previousSibling;a5+=be.nodeValue.length}}var a8=p(a2),bb=a2.parentNode;var a6=p(be),a3=be.parentNode;for(var bg=a2;bg.previousSibling;bg=bg.previousSibling){if(bg.nodeType==3&&bg.previousSibling.nodeType==3){a8--}}for(var bf=be;bf.previousSibling;bf=bf.previousSibling){if(bf.nodeType==3&&bf.previousSibling.nodeType==3){a6--}}g(bb);if(a2.nodeType==3){a2=bb.childNodes[a8]}g(a3);if(be.nodeType==3){be=a3.childNodes[a6]}if(bd){if(a2.nodeType==3){a9.setStart(a2,bc)}else{a9[a7?"setStartAfter":"setStartBefore"](a2)}a9.collapse(true)}else{if(a2.nodeType==3){a9.setStart(a2,bc)}else{a9.setStartBefore(a2)}if(be.nodeType==3){a9.setEnd(be,a5)}else{a9.setEndAfter(be)}}if(a1){this.removeCaret(a9)}}}var at=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/;var U={nodes:function(a2){var a1=j(a2);if(!a1.length){a2.selectNodeContents(a2.commonAncestorContainer);a1=j(a2);if(!a1.length){a1=D.significantChildNodes(a2.commonAncestorContainer)}}return a1},image:function(a2){var a1=[];new l(a2).traverse(function(a3){if(D.is(a3,"img")){a1.push(a3)}});if(a1.length==1){return a1[0]}},expand:function(a2){var a3=a2.cloneRange();var a6=a3.startContainer.childNodes[a3.startOffset==0?0:a3.startOffset-1];var a7=a3.endContainer.childNodes[a3.endOffset];if(!af(a6)||!af(a7)){return a3}var a4=a6.nodeValue;var a5=a7.nodeValue;if(a4==""||a5==""){return a3}var a1=a4.split("").reverse().join("").search(at);var a8=a5.search(at);if(a1==0||a8==0){return a3}a8=a8==-1?a5.length:a8;a1=a1==-1?0:a4.length-a1;a3.setStart(a6,a1);a3.setEnd(a7,a8);return a3},isExpandable:function(a2){var a7=a2.startContainer;var a6=q(a2);if(a7==a6||a7==a6.body){return false}var a3=a2.cloneRange();var a1=a7.nodeValue;if(!a1){return false}var a4=a1.substring(0,a3.startOffset);var a5=a1.substring(a3.startOffset);var a8=0,a9=0;if(a4!=""){a8=a4.split("").reverse().join("").search(at)}if(a5!=""){a9=a5.search(at)}return a8!=0&&a9!=0}};function c(a2){var a3=new an(a2.range);var a1=new ac();this.formatter=a2.formatter;this.getRange=function(){return a3.toRange()};this.lockRange=function(a4){return a1.add(this.getRange(),a4)};this.releaseRange=function(a4){a1.remove(a4);O(a4)};this.undo=function(){a3.body.innerHTML=a3.html;O(a3.toRange())};this.redo=function(){this.exec()};this.exec=function(){var a4=this.lockRange(true);this.formatter.editor=this.editor;this.formatter.toggle(a4);this.releaseRange(a4)}}function aW(a3,a2){var a1=a3.body;this.redo=function(){a1.innerHTML=a2.html;O(a2.toRange())};this.undo=function(){a1.innerHTML=a3.html;O(a3.toRange())}}function t(a1){c.call(this,a1);this.managesUndoRedo=true;this.exec=function(){var a3=this.editor;var a2=a3.getRange();var a4=new an(a2);a3.clipboard.paste(a1.value||"");a3.undoRedoStack.push(new aW(a4,new an(a3.getRange())));a3.focus()}}function x(){X.call(this);this.command=function(a1){return new t(a1)};this.update=function(a1,a2){a1.data("tSelectBox").close()};this.init=function(a3,a1){var a2=a1.editor;a3.tSelectBox({data:a2.insertHtml,onItemCreate:function(a4){a4.html=''+a4.dataItem.Text+""},onChange:function(a4){X.exec(a2,"insertHtml",a4.value)},highlightFirst:false}).find(".t-input").html(a2.localization.insertHtml)}}function R(){var a2=[],a1=-1;this.push=function(a3){a2=a2.slice(0,a1+1);a1=a2.push(a3)-1};this.undo=function(){if(this.canUndo()){a2[a1--].undo()}};this.redo=function(){if(this.canRedo()){a2[++a1].redo()}};this.canUndo=function(){return a1>=0};this.canRedo=function(){return a1!=a2.length-1}}function aR(a1){this.keydown=function(a5){var a4=a1.keyboard;var a2=a4.isTypingKey(a5);if(a2&&!a4.typingInProgress()){var a3=a1.getRange();this.startRestorePoint=new an(a3);a4.startTyping(s.proxy(function(){a1.selectionRestorePoint=this.endRestorePoint=new an(a1.getRange());a1.undoRedoStack.push(new aW(this.startRestorePoint,this.endRestorePoint))},this));return true}return false};this.keyup=function(a2){var a3=a1.keyboard;if(a3.typingInProgress()){a3.endTyping();return true}return false}}function A(a2){var a1=false;this.createUndoCommand=function(){this.endRestorePoint=new an(a2.getRange());a2.undoRedoStack.push(new aW(this.startRestorePoint,this.endRestorePoint));this.startRestorePoint=this.endRestorePoint};this.changed=function(){if(this.startRestorePoint){return this.startRestorePoint.html!=a2.body.innerHTML}return false};this.keydown=function(a3){var a4=a2.keyboard;if(a4.isModifierKey(a3)){if(a4.typingInProgress()){a4.endTyping(true)}this.startRestorePoint=new an(a2.getRange());return true}if(a4.isSystem(a3)){a1=true;if(this.changed()){a1=false;this.createUndoCommand()}return true}return false};this.keyup=function(a3){if(a1&&this.changed()){a1=false;this.createUndoCommand(a3);return true}return false}}function aH(a2){var a4=false;var a7;var a3;function a1(a8){return(a8>=48&&a8<=90)||(a8>=96&&a8<=111)||(a8>=186&&a8<=192)||(a8>=219&&a8<=222)}this.toolFromShortcut=function(ba,bc){var a9=String.fromCharCode(bc.keyCode);for(var bb in ba){var a8=ba[bb];if((a8.key==a9||a8.key==bc.keyCode)&&!!a8.ctrl==bc.ctrlKey&&!!a8.alt==bc.altKey&&!!a8.shift==bc.shiftKey){return bb}}};this.isTypingKey=function(a9){var a8=a9.keyCode;return(a1(a8)&&!a9.ctrlKey&&!a9.altKey)||a8==32||a8==13||a8==8||(a8==46&&!a9.shiftKey&&!a9.ctrlKey&&!a9.altKey)};this.isModifierKey=function(a9){var a8=a9.keyCode;return(a8==17&&!a9.shiftKey&&!a9.altKey)||(a8==16&&!a9.ctrlKey&&!a9.altKey)||(a8==18&&!a9.ctrlKey&&!a9.shiftKey)};this.isSystem=function(a8){return a8.keyCode==46&&a8.ctrlKey&&!a8.altKey&&!a8.shiftKey};this.startTyping=function(a8){a3=a8;a4=true};function a5(){a4=false;a3()}this.endTyping=function(a8){this.clearTimeout();if(a8){a5()}else{a7=window.setTimeout(a5,1000)}};this.typingInProgress=function(){return a4};this.clearTimeout=function(){window.clearTimeout(a7)};function a6(ba,a9){for(var a8=0;a8$/g,"li>");var a7=a1(ba);var a9=a5.getRange();a9.deleteContents();if(a9.startContainer==a5.document){a9.selectNodeContents(a5.body)}var bc=new ac();var bf=bc.addCaret(a9);var be=a3(a7,bf);var bd=false;if(!/body|td/.test(D.name(be))&&(a7||D.isInline(be))){a9.selectNode(bf);am(a9,be,true);bd=true}var bg=a2(ba);if(bg.firstChild&&bg.firstChild.className==="t-paste-container"){var bb=[];for(a6=0,a8=bg.childNodes.length;a6"))}a9.insertNode(bg);be=a3(a7,bf);if(bd){while(bf.parentNode!=be){D.unwrap(bf.parentNode)}D.unwrap(bf.parentNode)}g(a9.commonAncestorContainer);bf.style.display="inline";D.scrollTo(bf);bc.removeCaret(a9);O(a9)}}function f(){var a1=[//g,"",/mso-[^;"]*;?/ig,"",/<\/?(meta|link|style|o:|v:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:)[^>]*>)?/ig,""];this.applicable=function(a4){return/class="?Mso|style="[^"]*mso-/i.test(a4)};function a2(a4){if(/^[\u2022\u00b7\u00a7\u00d8o\-]\u00a0+/.test(a4)){return"ul"}if(/^\s*\w+[\.\)]\u00a0{2,}/.test(a4)){return"ol"}}function a3(bh){var a9=D.create(document,"div",{innerHTML:bh});var bg=s(H.join(","),a9);var bb=-1,a6,bf={ul:{},ol:{}},a4=a9;for(var bc=0;bc]*>/g,"").replace(/ /g,"\u00a0");var ba=a2(bh);if(!ba||D.name(a7)!="p"){if(a7.innerHTML==""){D.remove(a7)}else{bf={ul:{},ol:{}};a4=a9;bb=-1}continue}var bd=parseFloat(a7.style.marginLeft||0);var be=bf[ba][bd];if(bd>bb||!be){be=D.create(document,ba);if(a4==a9){D.insertBefore(be,a7)}else{a4.appendChild(be)}bf[ba][bd]=be}if(a6!=ba){for(var a8 in bf){for(var a5 in bf[a8]){if(s.contains(be,bf[a8][a5])){delete bf[a8][a5]}}}}D.remove(a7.firstChild);a4=D.create(document,"li",{innerHTML:a7.innerHTML});be.appendChild(a4);D.remove(a7);bb=bd;a6=ba}return a9.innerHTML}this.clean=function(a5){for(var a4=0,a6=a1.length;a4]*"?/ig,"");return a5}}function i(a1){function a2(a5){var a3=0;for(var a4=a5.parentNode.firstChild;a4;a4=a4.nextSibling){if(a4!=a5&&a4.className!="t-marker"&&a4.nodeType==1){a3++}}return a3}this.findSuitable=function(a4,a3){if(!a3&&a2(a4)>0){return null}return D.parentOfType(a4,a1[0].tags)};this.findFormat=function(a7){for(var a3=0;a30){this.activate(a7,a6)}};this.apply=function(a9){var a8=[];for(var a6=0,a7=a9.length;a60){for(var a6=0,a9=ba.length;a61){var a6=a8.pop();var a7=a8[a8.length-1];if(a6.previousSibling&&a6.previousSibling.className=="t-marker"){a7.appendChild(a6.previousSibling)}if(a6.previousSibling==a7&&a6.style.cssText==a7.style.cssText){while(a6.firstChild){a7.appendChild(a6.firstChild)}D.remove(a6)}}}}function a0(a2,a1){i.call(this,a2);function a3(a7){var bi=a7.attributes,bf=s.trim;if(!bi){return}for(var a6=0,bd=bi.length;a6=0?D.toHex(a5):a5}}}}return}function a4(a9){var ba=s(af(a9)?a9.parentNode:a9);var a8=ba.parents().andSelf();for(var a6=0,a7=a8.length;a6'+a9.dataItem.Text+""}}}function aY(a3){X.call(this,a3);var a2=[{tags:["span"]}],a1=new a0(a2,a3.cssAttr);this.update=function(a4){a4.data("tColorPicker").close()};this.command=function(a4){return new aJ(s.extend(a4,{formatter:function(){var a5={};a5[a3.domAttr]=a4.value;return new F(a2,{style:a5},a3.cssAttr)}}))};this.willDelayExecution=ad;this.init=function(a6,a4){var a5=a4.editor;a6.tColorPicker({selectedColor:"#000000",onChange:function(a7){X.exec(a5,a3.name,a7.value)}})}}function ab(){X.call(this);var a2=[{tags:["span"]}],a1=new a0(a2,"className");this.command=function(a3){return new aJ(s.extend(a3,{formatter:function(){return new F(a2,{className:a3.value})}}))};this.update=function(a3,a5){var a4=a3.data("tSelectBox");a4.close();a4.value(a1.getFormat(a5))};this.init=function(a5,a3){var a4=a3.editor;a5.tSelectBox({data:a4.style,title:a4.localization.style,onItemCreate:function(a6){var a7=D.inlineStyle(a4.document,"span",{className:a6.dataItem.Value});a6.html=''+a6.html+""},onChange:function(a6){X.exec(a4,"style",a6.value)}})}}function y(a2){function a1(a5,a6){for(var a3=0;a3'+a6.dataItem.Text+""},onChange:function(a5){X.exec(a3,"formatBlock",a5.value)},highlightFirst:false})}}function aS(a1){c.call(this,a1);this.exec=function(){var a4=this.getRange(),be=q(a4),a7,bc=s.browser.msie?"":'
';var a6="p,h1,h2,h3,h4,h5,h6".split(","),bf=D.parentOfType(a4.startContainer,a6),a2=D.parentOfType(a4.endContainer,a6),a3=(bf&&!a2)||(!bf&&a2);a4.deleteContents();var bd=D.create(be,"a");a4.insertNode(bd);g(bd.parentNode);var a5=D.parentOfType(bd,["li"]),bg=D.parentOfType(bd,"h1,h2,h3,h4,h5,h6".split(","));if(a5){var a9=a4.cloneRange();a9.selectNode(a5);if(j(a9).length==0){var bh=D.create(be,"p");if(a5.nextSibling){am(a9,a5.parentNode)}D.insertAfter(bh,a5.parentNode);D.remove(a5.parentNode.childNodes.length==1?a5.parentNode:a5);bh.innerHTML=bc;a7=bh}}else{if(bg&&!bd.nextSibling){var bh=D.create(be,"p");D.insertAfter(bh,bg);bh.innerHTML=bc;D.remove(bd);a7=bh}}if(!a7){if(!(a5||bg)){new W([{tags:["p"]}]).apply([bd])}a4.selectNode(bd);var a8=D.parentOfType(bd,[a5?"li":bg?D.name(bg):"p"]);am(a4,a8,a3);var ba=a8.previousSibling;if(D.is(ba,"li")&&ba.firstChild&&!D.is(ba.firstChild,"br")){ba=ba.firstChild}a7=a8.nextSibling;if(D.is(a7,"li")&&a7.firstChild&&!D.is(a7.firstChild,"br")){a7=a7.firstChild}D.remove(a8);function bb(bi){if(bi.firstChild&&D.is(bi.firstChild,"br")){D.remove(bi.firstChild)}if(af(bi)&&bi.nodeValue==""){bi=bi.parentNode}if(bi&&!D.is(bi,"img")&&bi.innerHTML==""){bi.innerHTML=bc}}bb(ba);bb(a7);g(ba)}g(a7);if(!D.is(a7,"img")){a4.selectNodeContents(a7)}else{a4.setStartBefore(a7)}a4.collapse(true);D.scrollTo(a7);O(a4)}}function d(a1){c.call(this,a1);this.exec=function(){var a3=this.getRange();a3.deleteContents();var a2=D.create(q(a3),"br");a3.insertNode(a2);g(a2.parentNode);if(!s.browser.msie&&(!a2.nextSibling||D.isWhitespace(a2.nextSibling))){var a4=a2.cloneNode(true);a4.setAttribute("_moz_dirty","");D.insertAfter(a4,a2)}a3.setStartAfter(a2);a3.collapse(true);O(a3)}}function ap(a2){var a1=[a2=="ul"?"ol":"ul",a2];y.call(this,[{tags:a1}]);this.isFormatted=function(a6){var a3=[],a4;for(var a5=0;a51){D.insertAfter(a4[a4.length-1],a5);D.insertAfter(a4[1],a5);D[a3.length>0?"insertBefore":"insertAfter"](a4[0],a5)}}else{var a6=new b([{tags:["a"]}],a7);a6.finder=this.finder;a6.apply(a3)}}}function ao(a1){a1.formatter={toggle:function(a2){new b([{tags:["a"]}]).remove(j(a2))}};c.call(this,a1)}function aa(a2){c.call(this,a2);var a1;this.async=true;var a3=new aX();this.exec=function(){var a8=this.getRange();var a6=a8.collapsed;a8=this.lockRange(true);var bb=j(a8);var ba=null;var a5=this;function bc(bi){var bh=s("#t-editor-link-url",a9.element).val();if(bh&&bh!="http://"){a1={href:bh};var be=s("#t-editor-link-title",a9.element).val();if(be){a1.title=be}var bf=s("#t-editor-link-text",a9.element).val();if(bf!==ba){a1.innerHTML=bf}var bg=s("#t-editor-link-target",a9.element).is(":checked");if(bg){a1.target="_blank"}a3.apply(a8,a1)}a7(bi);if(a5.change){a5.change()}}function a7(be){be.preventDefault();a9.destroy();az(q(a8)).focus();a5.releaseRange(a8)}var bd=bb.length?a3.finder.findSuitable(bb[0]):null;var a4=bb.length<=1||(bb.length==2&&a6);var a9=ar.window.create(s.extend({},this.editor.dialogOptions,{title:"Insert link",html:new s.telerik.stringBuilder().cat('
').cat("
    ").cat('
  1. ').catIf('
  2. ',a4).cat('
  3. ').cat('
  4. ').cat("
").cat('
').cat('').cat(" or ").cat('Close').cat("
").cat("
").string(),onClose:a7})).hide().find(".t-dialog-insert").click(bc).end().find(".t-dialog-close").click(a7).end().find(".t-form-text-row input").keydown(function(be){if(be.keyCode==13){bc(be)}else{if(be.keyCode==27){a7(be)}}}).end().find("#t-editor-link-url").val(bd?bd.getAttribute("href",2):"http://").end().find("#t-editor-link-text").val(bb.length>0?(bb.length==1?bb[0].nodeValue:bb[0].nodeValue+bb[1].nodeValue):"").end().find("#t-editor-link-title").val(bd?bd.title:"").end().find("#t-editor-link-target").attr("checked",bd?bd.target=="_blank":false).end().show().data("tWindow").center();if(a4&&bb.length>0){ba=s("#t-editor-link-text",a9.element).val()}s("#t-editor-link-url",a9.element).focus().select()},this.redo=function(){var a4=this.lockRange(true);a3.apply(a4,a1);this.releaseRange(a4)}}function aT(a2){X.call(this,s.extend(a2,{command:ao}));var a1=new i([{tags:["a"]}]);this.init=function(a3){a3.attr("unselectable","on").addClass("t-state-disabled")};this.update=function(a3,a4){a3.toggleClass("t-state-disabled",!a1.isFormatted(a4)).removeClass("t-state-hover")}}function aO(a2){c.call(this,a2);this.async=true;var a1;function a3(a4,a5){if(a1.src&&a1.src!="http://"){if(!a4){a4=D.create(q(a5),"img",a1);a4.onload=a4.onerror=function(){a4.removeAttribute("complete");a4.removeAttribute("width");a4.removeAttribute("height")};a5.deleteContents();a5.insertNode(a4);a5.setStartAfter(a4);a5.setEndAfter(a4);O(a5);return true}else{D.attr(a4,a1)}}return false}this.redo=function(){var a4=this.lockRange();if(!a3(U.image(a4),a4)){this.releaseRange(a4)}};this.exec=function(){var a7=this.lockRange();var a4=false;var ba=U.image(a7);var a5=this;function bb(be){a1={src:s("#t-editor-image-url",a8.element).val(),alt:s("#t-editor-image-title",a8.element).val()};a4=a3(ba,a7);a6(be);if(a5.change){a5.change()}}function a6(be){be.preventDefault();a8.destroy();az(q(a7)).focus();if(!a4){a5.releaseRange(a7)}}var a9=this.editor.fileBrowser;var bc=a9&&a9.selectUrl!==undefined;function bd(){if(bc){new ar.imageBrowser(s(this).find(".t-image-browser"),s.extend(a9,{apply:bb,element:a5.editor.element,localization:a5.editor.localization}))}}var a8=ar.window.create(s.extend({width:750},this.editor.dialogOptions,{title:"Insert image",html:new s.telerik.stringBuilder().cat('
').catIf('
',bc).cat("
    ").cat('
  1. ').cat('
  2. ').cat("
").cat('
').cat('').cat(" or ").cat('Close').cat("
").cat("
").string(),onClose:a6,onActivate:bd})).hide().find(".t-dialog-insert").click(bb).end().find(".t-dialog-close").click(a6).end().find(".t-form-text-row input").keydown(function(be){if(be.keyCode==13){bb(be)}else{if(be.keyCode==27){a6(be)}}}).end().toggleClass("t-imagebrowser",bc).find("#t-editor-image-url").val(ba?ba.getAttribute("src",2):"http://").end().find("#t-editor-image-title").val(ba?ba.alt:"").end().show().data("tWindow").center();s("#t-editor-image-url",a8.element).focus().select()}}ar.selectbox=function(a1,a2){var a9;var a3=s(a1);var a5=a3.find(".t-input");var a6=this.dropDown=new ar.dropDown({effects:ar.fx.slide.defaults(),onItemCreate:a2.onItemCreate,onClick:function(ba){a8(a2.data[s(ba.item).index()].Value);a2.onChange({value:a9})}});function a4(){if(!a6.$items){a6.dataBind(a2.data)}}function a7(ba){a5.html(ba?ba:" ")}function a8(bc){a4();var bb=-1;for(var ba=0,bd=a2.data.length;ba0?"rtl":"");s(document.documentElement).bind("mousedown",s.proxy(function(bc){var ba=a6.$element;var bb=ba&&ba.parent().length>0;if(bb&&!s.contains(a1,bc.target)&&!s.contains(ba.parent()[0],bc.target)){a6.close()}},this))};s.fn.tSelectBox=function(a1){return ar.create(this,{name:"tSelectBox",init:function(a2,a3){return new ar.selectbox(a2,a3)},options:a1})};s.fn.tSelectBox.defaults={effects:ar.fx.slide.defaults()};ar.colorpicker=function(a1,a2){this.element=a1;var a3=s(a1);s.extend(this,a2);a3.bind("click",s.proxy(this.click,this)).find("*").attr("unselectable","on");if(this.selectedColor){a3.find(".t-selected-color").css("background-color",this.selectedColor)}s(a1.ownerDocument.documentElement).bind("mousedown",s.proxy(function(a4){if(!s(a4.target).closest(".t-colorpicker-popup").length){this.close()}},this));ar.bind(this,{change:this.onChange,load:this.onLoad})};ar.colorpicker.prototype={select:function(a1){if(a1){a1=D.toHex(a1);if(!ar.trigger(this.element,"change",{value:a1})){this.value(a1);this.close()}}else{ar.trigger(this.element,"change",{value:this.selectedColor})}},open:function(){var a1=this.popup();var a4=s(this.element);var a3=a4.offset();a3.top+=a4.outerHeight();if(a4.closest(".t-rtl").length){a3.left-=a1.outerWidth()-a4.outerWidth()}var a2="auto";a4.parents().andSelf().each(function(){a2=s(this).css("zIndex");if(Number(a2)){a2=Number(a2)+1;return false}});ar.fx._wrap(a1).css(s.extend({position:"absolute",zIndex:a2},a3));a1.find(".t-item").bind("click",s.proxy(function(a6){var a5=s(a6.target,a6.target.ownerDocument).css("background-color");this.select(a5)},this));ar.fx.play(this.effects,a1,{direction:"bottom"})},close:function(){if(!this.$popup){return}ar.fx.rewind(this.effects,this.$popup,{direction:"bottom"},s.proxy(function(){D.remove(this.$popup[0].parentNode);this.$popup=null},this))},toggle:function(){if(!this.$popup||!this.$popup.is(":visible")){this.open()}else{this.close()}},click:function(a1){if(s(a1.target).closest(".t-tool-icon").length>0){this.select()}else{this.toggle()}},value:function(a1){if(!a1){return this.selectedColor}a1=D.toHex(a1);this.selectedColor=a1;s(".t-selected-color",this.element).css("background-color",a1)},popup:function(){if(!this.$popup){this.$popup=s(ar.colorpicker.buildPopup(this)).hide().appendTo(document.body).find("*").attr("unselectable","on").end()}return this.$popup}};s.extend(ar.colorpicker,{buildPopup:function(a1){var a4=new ar.stringBuilder();a4.cat('
').cat('
    ');var a6=a1.data;var a3=(a1.value()||"").substring(1);for(var a2=0,a5=a6.length;a2')}a4.cat("
");return a4.string()}});s.fn.tColorPicker=function(a1){return ar.create(this,{name:"tColorPicker",init:function(a2,a3){return new ar.colorpicker(a2,a3)},options:a1})};s.fn.tColorPicker.defaults={data:"000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7".split(","),selectedColor:null,effects:ar.fx.slide.defaults()};function aV(){var a2=new y([{tags:H}]);function a1(a3){return a3.style.marginLeft||0}this.apply=function(a8){var a6=a2.findSuitable(a8);if(a6.length){var a5=[];for(var a4=0;a4ul")[0];if(!bb){bb=D.create(a9.ownerDocument,D.name(bc));a7.append(bb)}while(a9&&a9.parentNode==bc){bb.appendChild(a9);a9=a5.shift()}}else{var a3=parseInt(a1(a9))+30;D.style(a9,{marginLeft:a3})}}}else{var ba=new W([{tags:H}],{style:{marginLeft:30}});ba.apply(a8)}};this.remove=function(a5){var a7=a2.findSuitable(a5);for(var a3=0;a31)||(D.ofType(a4[a3],["ul","ol"])&&a7>0)}if(a5){a2.removeClass("t-state-disabled");return}}a2.addClass("t-state-disabled").removeClass("t-state-hover")}}function aE(a1){this.editor=a1;this.formats=[]}aE.prototype={apply:function(a5){if(!this.hasPending()){return}var a4=new ac();a4.addCaret(a5);var a1=a5.startContainer.childNodes[a5.startOffset];var a7=a1.previousSibling;if(!a7.nodeValue){a7=a7.previousSibling}a5.setStart(a7,a7.nodeValue.length-1);a4.add(a5);if(j(a5).length==0){a4.remove(a5);a5.collapse(true);this.editor.selectRange(a5);return}var a3=a4.end.previousSibling.previousSibling;var a9,a6=this.formats;for(var a2=0;a20},isPending:function(a1){return !!this.getPending(a1)},getPending:function(a2){var a3=this.formats;for(var a1=0;a1",{src:'javascript:""',frameBorder:"0",className:"t-content"}).css("display","").insertBefore(a1)[0];var a2=a5.contentWindow||a5;var a4=a2.document||a5.contentDocument;var a3=a1.val().replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/ig,"$1");if(!a3.length&&s.browser.mozilla){a3='
'}a4.designMode="On";a4.open();a4.write(new ar.stringBuilder().cat("").cat('').cat('").cat(s.map(a6,function(a7){return[''].join("")}).join("")).cat('').cat(a3).cat("").string());a4.close();return a2}function V(a1){ar.trigger(a1.element,"selectionChange")}function aI(a2){var a1=true;a2.window=ax(s(a2.textarea),a2.stylesheets);a2.document=a2.window.contentDocument||a2.window.document;a2.body=a2.document.body;s(a2.document).bind({keydown:function(a5){var a3=a2.keyboard.toolFromShortcut(a2.tools,a5);if(a3){a5.preventDefault();a2.exec(a3);return false}if(a2.keyboard.isTypingKey(a5)&&a2.pendingFormats.hasPending()){if(a1){a1=false}else{var a4=a2.getRange();a2.pendingFormats.apply(a4);a2.selectRange(a4)}}a2.keyboard.clearTimeout();a2.keyboard.keydown(a5)},keyup:function(a5){var a4=[8,9,33,34,35,36,37,38,39,40,40,45,46];if(s.browser.mozilla&&a5.keyCode==8){aK(a2,a5)}if(s.inArray(a5.keyCode,a4)>-1||(a5.keyCode==65&&a5.ctrlKey&&!a5.altKey&&!a5.shiftKey)){a2.pendingFormats.clear();V(a2)}if(a2.keyboard.isTypingKey(a5)){if(a2.pendingFormats.hasPending()){var a3=a2.getRange();a2.pendingFormats.apply(a3);a2.selectRange(a3)}}else{a1=true}a2.keyboard.keyup(a5)},mousedown:function(a3){a2.pendingFormats.clear();var a4=s(a3.target);if(!s.browser.gecko&&a3.which==2&&a4.is("a[href]")){window.open(a4.attr("href"),"_new")}},mouseup:function(){V(a2)}});s(a2.window).bind("blur",function(){var a3=a2.textarea.value,a4=a2.encodedValue();a2.update(a4);if(a4!=a3){ar.trigger(a2.element,"change")}});s(a2.body).bind("cut paste",function(a3){a2.clipboard["on"+a3.type](a3)})}ar.editor=function(a1,a2){if(/Mobile.*Safari/.test(navigator.userAgent)){return}var a3=this;this.element=a1;var a4=s(a1);a4.closest("form").bind("submit",function(){a3.update()});s.extend(this,a2);ar.bind(this,{load:this.onLoad,selectionChange:this.onSelectionChange,change:this.onChange,execute:this.onExecute,error:this.onError});for(var a7 in this.tools){this.tools[a7].name=a7.toLowerCase()}this.textarea=a4.find("textarea").attr("autocomplete","off")[0];aI(this);this.keyboard=new aH([new aR(this),new A(this)]);this.clipboard=new aA(this);this.pendingFormats=new aE(this);this.undoRedoStack=new R();function bb(bc){var bd=s.grep(bc.className.split(" "),function(be){return !/^t-(widget|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(be)});return bd[0]?bd[0].substring(2):"custom"}function a8(bd,bc){if(!bc.key){return bd}return new ar.stringBuilder().cat(bd).cat(" (").catIf("Ctrl + ",bc.ctrl).catIf("Shift + ",bc.shift).catIf("Alt + ",bc.alt).cat(bc.key).cat(")").string()}var a6=".t-editor-toolbar > li > *",a5=".t-editor-button .t-tool-icon",a9=a5+":not(.t-state-disabled)",ba=a5+".t-state-disabled";a4.delegate(a9,"mouseenter",ar.hover).delegate(a9,"mouseleave",ar.leave).delegate(a5,"mousedown",ar.preventDefault).delegate(a9,"click",ar.stopAll(function(bc){a3.exec(bb(this))})).delegate(ba,"click",function(bc){bc.preventDefault()}).find(a6).each(function(){var bg=bb(this),bd=a3.tools[bg],bf=a3.localization[bg],be=s(this);if(!bd){return}if(bg=="fontSize"||bg=="fontName"){var bc=a3.localization[bg+"Inherit"]||aP[bg+"Inherit"];a3[bg][0].Text=bc;be.find("input").val(bc).end().find("span.t-input").text(bc).end()}bd.init(be,{title:a8(bf,bd),editor:a3})}).end().bind("selectionChange",function(){var bd=a3.getRange();a3.selectionRestorePoint=new an(bd);var bc=j(bd);if(!bc.length){bc=[bd.startContainer]}a4.find(a6).each(function(){var be=a3.tools[bb(this)];if(be){be.update(s(this),bc,a3.pendingFormats)}})});s(document).bind("DOMNodeInserted",function(bc){if(s.contains(bc.target,a3.element)||a3.element==bc.target){s(a3.element).find("iframe").remove();aI(a3)}}).bind("mousedown",function(bc){try{if(a3.keyboard.typingInProgress()){a3.keyboard.endTyping(true)}if(!a3.selectionRestorePoint){a3.selectionRestorePoint=new an(a3.getRange())}}catch(bc){}})};function aK(a1,a4){var a2=a1.getRange(),a5=a2.startContainer;if(a5==a1.body.firstChild||!D.isBlock(a5)||(a5.childNodes.length>0&&!(a5.childNodes.length==1&&D.is(a5.firstChild,"br")))){return}var a7=a5.previousSibling;while(a7&&!D.isBlock(a7)){a7=a7.previousSibling}if(!a7){return}var a6=a1.document.createTreeWalker(a7,NodeFilter.SHOW_TEXT,null,false);var a3;while(a3=a6.nextNode()){a7=a3}a2.setStart(a7,af(a7)?a7.nodeValue.length:0);a2.collapse(true);O(a2);D.remove(a5);a4.preventDefault()}s.extend(ar.editor,{BlockFormatFinder:y,BlockFormatter:W,Dom:D,FormatCommand:aJ,GenericCommand:aW,GreedyBlockFormatter:au,GreedyInlineFormatFinder:a0,GreedyInlineFormatter:F,ImageCommand:aO,IndentCommand:o,IndentFormatter:aV,InlineFormatFinder:i,InlineFormatter:b,InsertHtmlCommand:t,Keyboard:aH,LinkCommand:aa,LinkFormatFinder:I,LinkFormatter:aX,ListCommand:ay,ListFormatFinder:ap,ListFormatter:J,MSWordFormatCleaner:f,Marker:ac,NewLineCommand:d,OutdentCommand:S,ParagraphCommand:aS,PendingFormats:aE,RangeEnumerator:aj,RangeUtils:U,RestorePoint:an,SystemHandler:A,TypingHandler:aR,UndoRedoStack:R,UnlinkCommand:ao});ar.editor.prototype={value:function(a3){var a1=this.body;if(a3===undefined){return C(a1)}this.pendingFormats.clear();a3=a3.replace(//g,"");a3=a3.replace(/]*)>(.*)?<\/script>/ig,"$2");if(s.browser.mozilla){a3=a3.replace(/]*)>(\s*)?<\/p>/ig,'


')}if(s.browser.msie&&parseInt(s.browser.version)<9){a3="
"+a3;var a4="originalsrc",a2="originalhref";a3=a3.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,a2+'="$1"');a3=a3.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,a4+'="$1"');a1.innerHTML=a3;D.remove(a1.firstChild);s(a1).find("telerik\\:script,script,link,img,a").each(function(){var a5=this;if(a5[a2]){a5.setAttribute("href",a5[a2]);a5.removeAttribute(a2)}if(a5[a4]){a5.setAttribute("src",a5[a4]);a5.removeAttribute(a4)}})}else{a1.innerHTML=a3;if(s.browser.msie){g(a1)}}this.selectionRestorePoint=null;this.update()},focus:function(){this.window.focus()},update:function(a1){this.textarea.value=a1||this.encoded?this.encodedValue():this.value()},encodedValue:function(){return D.encode(this.value())},createRange:function(a1){return aQ(a1||this.document)},getSelection:function(){return aZ(this.document)},selectRange:function(a2){this.focus();var a1=this.getSelection();a1.removeAllRanges();a1.addRange(a2)},getRange:function(){var a2=this.getSelection();var a1=a2.rangeCount>0?a2.getRangeAt(0):this.createRange();if(a1.startContainer==this.document&&a1.endContainer==this.document&&a1.startOffset==0&&a1.endOffset==0){a1.setStart(this.body,0);a1.collapse(true)}return a1},selectedHtml:function(){return C(this.getRange().cloneContents())},paste:function(a1){this.clipboard.paste(a1)},exec:function(a4,a1){if(!this.keyboard.typingInProgress()){this.focus();if(this.selectionRestorePoint){this.selectRange(this.selectionRestorePoint.toRange());this.selectionRestorePoint=null}}a4=a4.toLowerCase();var a6="";for(var a3 in this.tools){if(a3.toLowerCase()==a4){a6=this.tools[a3];break}}if(a6){var a2=this.getRange();if(!/undo|redo/i.test(a4)&&a6.willDelayExecution(a2)){this.pendingFormats.toggle({name:a4,params:a1,command:a6.command});V(this);return}var a5=a6.command?a6.command(s.extend({range:a2},a1)):null;ar.trigger(this.element,"execute",{name:a4,command:a5});if(/undo|redo/i.test(a4)){this.undoRedoStack[a4]()}else{if(a5){if(!a5.managesUndoRedo){this.undoRedoStack.push(a5)}a5.editor=this;a5.exec();if(a5.async){a5.change=s.proxy(function(){V(this)},this);return}}}V(this)}}};s.fn.tEditor=function(a1){return ar.create(this,{name:"tEditor",init:function(a2,a3){return new ar.editor(a2,a3)},options:a1})};var ak={bold:[{tags:["strong"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}],italic:[{tags:["em"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}],underline:[{tags:["span"],attr:{style:{textDecoration:"underline"}}}],strikethrough:[{tags:["del"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}],justifyLeft:[{tags:H,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left"}}}],justifyCenter:[{tags:H,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto"}}}],justifyRight:[{tags:H,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right"}}}],justifyFull:[{tags:H,attr:{style:{textAlign:"justify"}}}]};function ae(a3,a2){for(var a1=0;a1=0){return a2[a1]}}}function X(a1){s.extend(this,a1);this.init=function(a2,a3){a2.attr({unselectable:"on",title:a3.title})};this.command=function(a2){return new a1.command(a2)};this.update=function(){};this.willDelayExecution=function(){return false}}X.exec=function(a2,a3,a1){a2.exec(a3,{value:a1})};function ai(a1){X.call(this,a1);this.command=function(a2){return new aJ(s.extend(a2,{formatter:a1.formatter}))};this.update=function(a2,a6,a4){var a3=a4.isPending(this.name),a5=a1.finder.isFormatted(a6),a7=a3?!a5:a5;a2.toggleClass("t-state-active",a7)}}var Q=function(){return{isFormatted:function(){return false}}};var aP={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertHtml:"Insert HTML",fontName:"Select font family",fontNameInherit:"(inherited font)",fontSize:"Select font size",fontSizeInherit:"(inherited size)",formatBlock:"Format",style:"Styles",emptyFolder:"Empty Folder",uploadFile:"Upload",orderBy:"Arrange by:",orderBySize:"Size",orderByName:"Name",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',deleteFile:'Are you sure you want to delete "{0}"?',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',directoryNotFound:"A directory with this name was not found."};s.fn.tEditor.defaults={localization:aP,formats:ak,encoded:true,stylesheets:[],dialogOptions:{modal:true,resizable:false,draggable:true,effects:{list:[{name:"toggle"}]}},fontName:[{Text:aP.fontNameInherit,Value:"inherit"},{Text:"Arial",Value:"Arial,Helvetica,sans-serif"},{Text:"Courier New",Value:"'Courier New',Courier,monospace"},{Text:"Georgia",Value:"Georgia,serif"},{Text:"Impact",Value:"Impact,Charcoal,sans-serif"},{Text:"Lucida Console",Value:"'Lucida Console',Monaco,monospace"},{Text:"Tahoma",Value:"Tahoma,Geneva,sans-serif"},{Text:"Times New Roman",Value:"'Times New Roman',Times,serif"},{Text:"Trebuchet MS",Value:"'Trebuchet MS',Helvetica,sans-serif"},{Text:"Verdana",Value:"Verdana,Geneva,sans-serif"}],fontSize:[{Text:aP.fontSizeInherit,Value:"inherit"},{Text:"1 (8pt)",Value:"xx-small"},{Text:"2 (10pt)",Value:"x-small"},{Text:"3 (12pt)",Value:"small"},{Text:"4 (14pt)",Value:"medium"},{Text:"5 (18pt)",Value:"large"},{Text:"6 (24pt)",Value:"x-large"},{Text:"7 (36pt)",Value:"xx-large"}],formatBlock:[{Text:"Paragraph",Value:"p"},{Text:"Quotation",Value:"blockquote"},{Text:"Heading 1",Value:"h1"},{Text:"Heading 2",Value:"h2"},{Text:"Heading 3",Value:"h3"},{Text:"Heading 4",Value:"h4"},{Text:"Heading 5",Value:"h5"},{Text:"Heading 6",Value:"h6"}],tools:{bold:new Y({key:"B",ctrl:true,format:ak.bold}),italic:new Y({key:"I",ctrl:true,format:ak.italic}),underline:new Y({key:"U",ctrl:true,format:ak.underline}),strikethrough:new Y({format:ak.strikethrough}),undo:{key:"Z",ctrl:true},redo:{key:"Y",ctrl:true},insertLineBreak:new X({key:13,shift:true,command:d}),insertParagraph:new X({key:13,command:aS}),justifyCenter:new P({format:ak.justifyCenter}),justifyLeft:new P({format:ak.justifyLeft}),justifyRight:new P({format:ak.justifyRight}),justifyFull:new P({format:ak.justifyFull}),insertUnorderedList:new aN({tag:"ul"}),insertOrderedList:new aN({tag:"ol"}),createLink:new X({key:"K",ctrl:true,command:aa}),unlink:new aT({key:"K",ctrl:true,shift:true}),insertImage:new X({command:aO}),indent:new X({command:o}),outdent:new ag(),insertHtml:new x(),style:new ab(),fontName:new aC({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName"}),fontSize:new aC({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize"}),formatBlock:new n(),foreColor:new aY({cssAttr:"color",domAttr:"color",name:"foreColor"}),backColor:new aY({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor"})}}})(jQuery);