(function(a){var b=a.telerik;b.scripts.push("telerik.editor.js");function av(a7){var a8={};for(var a6=0;a6=8){az=function(a7){if(a7.nodeType==1&&a7.firstChild){var a8=a7.firstChild,a6=a8;while(a6=a6.nextSibling){if(a6.nodeType==3&&a8.nodeType==3){a6.nodeValue=a8.nodeValue+a6.nodeValue;v.remove(a8)}a8=a6}}}}function E(a7){var a6=0;while(a7=a7.previousSibling){a6++}return a6}function ak(a6){return a6&&a6.nodeValue!==null&&a6.data!==null}function ai(a8,a7){try{return !ak(a8)&&(a.contains(a8,ak(a7)?a7.parentNode:a7)||a7.parentNode==a8)}catch(a6){return false}}function aj(a7,a6){return ai(a7,a6)||a7==a6}function D(a7,a6){if(ai(a7,a6)){while(a6&&a6.parentNode!=a7){a6=a6.parentNode}}return a6}function R(a6){return ak(a6)?a6.length:a6.childNodes.length}function aQ(a7,a8){var a6=a7.cloneNode(false);a7.deleteData(a8,a7.length);a6.deleteData(0,a8);v.insertAfter(a6,a7)}function e(a8,a6){for(var a7 in a6){var a9=a8[a7];if(a7=="float"){a9=a8[a.support.cssFloat?"cssFloat":"styleFloat"]}if(typeof a9=="object"){if(!e(a9,a6[a7])){return false}}else{if(a9!=a6[a7]){return false}}}return true}var a4=/^\s+$/;var aJ=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i;var t=("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 v={blockParentOrBody:function(a6){return v.parentOfType(a6,g)||a6.ownerDocument.body},normalize:az,toHex:function(a6){var a7=aJ.exec(a6);if(!a7){return a6}return"#"+a.map(a7.slice(1),function(a8){return a8=parseInt(a8).toString(16),a8.length>1?a8:"0"+a8}).join("")},encode:function(a6){return a6.replace(/&/g,"&").replace(//g,">").replace(/\u00a0/g," ")},name:function(a6){return a6.nodeName.toLowerCase()},significantChildNodes:function(a6){return a.grep(a6.childNodes,function(a7){return a7.nodeType!=3||!v.isWhitespace(a7)})},lastTextNode:function(a7){if(a7.nodeType==3){return a7}var a8=null;for(var a6=a7.lastChild;a6;a6=a6.previousSibling){if(a8=v.lastTextNode(a6)){return a8}}return a8},is:function(a6,a7){return v.name(a6)==a7},isMarker:function(a6){return a6.className=="t-marker"},isWhitespace:function(a6){return a4.test(a6.nodeValue)},isBlock:function(a6){return f[v.name(a6)]},isEmpty:function(a6){return x[v.name(a6)]},isInline:function(a6){return aa[v.name(a6)]},scrollTo:function(a6){a6.ownerDocument.body.scrollTop=a(ak(a6)?a6.parentNode:a6).offset().top},insertAt:function(a7,a6,a8){a7.insertBefore(a6,a7.childNodes[a8]||null)},insertBefore:function(a6,a7){if(a7.parentNode){return a7.parentNode.insertBefore(a6,a7)}else{return a7}},insertAfter:function(a6,a7){return a7.parentNode.insertBefore(a6,a7.nextSibling)},remove:function(a6){a6.parentNode.removeChild(a6)},trim:function(a8){for(var a6=a8.childNodes.length-1;a6>=0;a6--){var a7=a8.childNodes[a6];if(ak(a7)){if(a7.nodeValue.replace(/\ufeff/g,"").length==0){v.remove(a7)}if(v.isWhitespace(a7)){v.insertBefore(a7,a8)}}else{if(a7.className!="t-marker"){v.trim(a7);if(a7.childNodes.length==0&&!v.isEmpty(a7)){v.remove(a7)}}}}return a8},parentOfType:function(a6,a7){do{a6=a6.parentNode}while(a6&&!(v.ofType(a6,a7)));return a6},ofType:function(a6,a7){return a.inArray(v.name(a6),a7)>=0},changeTag:function(bb,bc){var ba=v.create(bb.ownerDocument,bc);var a7=bb.attributes;for(var a8=0;a8]*>/i,z=/

<\/p>/i;function w(ba){var a9=[];var bb={"telerik:script":{start:function(bc){a9.push("")},end:function(){a9.push("")}},b:{start:function(){a9.push("")},end:function(){a9.push("")}},i:{start:function(){a9.push("")},end:function(){a9.push("")}},u:{start:function(){a9.push('')},end:function(){a9.push("")}},font:{start:function(be){a9.push('')},end:function(bc){a9.push("")}}};function a6(bo){var bs=[],bf=bo.attributes,bt=a.trim;if(v.is(bo,"img")){var bv=bo.style.width,bj=bo.style.height,bc=a(bo);if(bv){bc.attr("width",parseInt(bv));v.unstyle(bo,{width:undefined})}if(bj){bc.attr("height",parseInt(bj));v.unstyle(bo,{height:undefined})}}for(var bk=0,bl=bf.length;bkbx.nodeName?1:bw.nodeName=0){bu=v.toHex(bu)}if(bq.indexOf("font")>=0){bu=bu.replace(aE,"'")}a9.push(bq);a9.push(":");a9.push(bu);a9.push(";")}}}else{if(be=="src"||be=="href"){a9.push(bo.getAttribute(be,2))}else{a9.push(C[be]?be:bg)}}a9.push('"')}}function a8(bd,be){for(var bc=bd.firstChild;bc;bc=bc.nextSibling){a7(bc,be)}}function a7(bd,bh){var be=bd.nodeType;if(be==1){if(bd.attributes._moz_dirty&&v.is(bd,"br")){return}var bi=v.name(bd);var bc=bb[bi];if(bc){bc.start(bd);a8(bd);bc.end(bd);return}a9.push("<");a9.push(bi);a6(bd);if(x[bi]){a9.push(" />")}else{a9.push(">");a8(bd,bh||v.is(bd,"pre"));a9.push("")}}else{if(be==3){var bj=bd.nodeValue;if(!bh&&a.support.leadingWhitespace){var bf=bd.parentNode;var bg=bd.previousSibling;if(!bg){bg=(v.isInline(bf)?bf:bd).previousSibling}if(!bg||bg.innerHTML==""||v.isBlock(bg)){bj=bj.replace(/^[\r\n\v\f\t ]+/,"")}bj=bj.replace(/ +/," ")}a9.push(v.encode(bj))}else{if(be==4){a9.push("")}else{if(be==8){if(bd.data.indexOf("[CDATA[")<0){a9.push("")}else{a9.push("")}}}}}}a8(ba);a9=a9.join("");if(a9.replace(m,"").replace(z,"")==""){return""}return a9}var aS=0,aR=1,A=2,B=3;function u(a6){var a7=a6.startContainer;return a7.nodeType==9?a7:a7.ownerDocument}function aN(a6){if(a.browser.msie&&a.browser.version<9){return new a3(a6.document)}return a6.getSelection()}function aM(a7){var a6=u(a7);return aL(a6)}function aL(a6){return aN(a5(a6))}function a5(a6){return a6.defaultView||a6.parentWindow}function aP(a8,a6,a9){function a7(bc){var bb=a8.cloneRange();bb.collapse(bc);bb[bc?"setStartBefore":"setEndAfter"](a6);var ba=bb.extractContents();if(a9){ba=v.trim(ba)}v[bc?"insertBefore":"insertAfter"](ba,a6)}a7(true);a7(false)}function aO(a7){var a6=aH.image(a7);if(a6){a7.setStartAfter(a6);a7.setEndAfter(a6)}var a8=aM(a7);a8.removeAllRanges();a8.addRange(a7)}function a2(a6){a.extend(this,{ownerDocument:a6,startContainer:a6,endContainer:a6,commonAncestorContainer:a6,startOffset:0,endOffset:0,collapsed:true})}a2.prototype={setStart:function(a6,a7){this.startContainer=a6;this.startOffset=a7;a1(this);G(this,true)},setEnd:function(a6,a7){this.endContainer=a6;this.endOffset=a7;a1(this);G(this,false)},setStartBefore:function(a6){this.setStart(a6.parentNode,E(a6))},setStartAfter:function(a6){this.setStart(a6.parentNode,E(a6)+1)},setEndBefore:function(a6){this.setEnd(a6.parentNode,E(a6))},setEndAfter:function(a6){this.setEnd(a6.parentNode,E(a6)+1)},selectNode:function(a6){this.setStartBefore(a6);this.setEndAfter(a6)},selectNodeContents:function(a6){this.setStart(a6,0);this.setEnd(a6,a6[a6.nodeType===1?"childNodes":"nodeValue"].length)},collapse:function(a6){if(a6){this.setEnd(this.startContainer,this.startOffset)}else{this.setStart(this.endContainer,this.endOffset)}},deleteContents:function(){var a7=this.cloneRange();if(this.startContainer!=this.commonAncestorContainer){this.setStartAfter(D(this.commonAncestorContainer,this.startContainer))}this.collapse(true);(function a6(a8){while(a8.next()){a8.hasPartialSubtree()?a6(a8.getSubtreeIterator()):a8.remove()}})(new aG(a7))},cloneContents:function(){var a7=u(this);return(function a6(a9){for(var ba,a8=a7.createDocumentFragment();ba=a9.next();){ba=ba.cloneNode(!a9.hasPartialSubtree());if(a9.hasPartialSubtree()){ba.appendChild(a6(a9.getSubtreeIterator()))}a8.appendChild(ba)}return a8})(new aG(this))},extractContents:function(){var a8=this.cloneRange();if(this.startContainer!=this.commonAncestorContainer){this.setStartAfter(D(this.commonAncestorContainer,this.startContainer))}this.collapse(true);var a9=this;var a6=u(this);return(function a7(bb){for(var bc,ba=a6.createDocumentFragment();bc=bb.next();){bb.hasPartialSubtree()?bc=bc.cloneNode(false):bb.remove(a9.originalRange);if(bb.hasPartialSubtree()){bc.appendChild(a7(bb.getSubtreeIterator()))}ba.appendChild(bc)}return ba})(new aG(a8))},insertNode:function(a6){if(ak(this.startContainer)){if(this.startOffset!=this.startContainer.nodeValue.length){aQ(this.startContainer,this.startOffset)}v.insertAfter(a6,this.startContainer)}else{v.insertAt(this.startContainer,a6,this.startOffset)}this.setStart(this.startContainer,this.startOffset)},cloneRange:function(){return a.extend(new a2(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 a7=this.startContainer.nodeName,a6=this.endContainer.nodeName;return[a7=="#text"?this.startContainer.nodeValue:a7,"(",this.startOffset,") : ",a6=="#text"?this.endContainer.nodeValue:a6,"(",this.endOffset,")"].join("")}};function q(bb,a7,bd,a9){if(bb==a7){return a9-bd}var a6=a7;while(a6&&a6.parentNode!=bb){a6=a6.parentNode}if(a6){return E(a6)-bd}a6=bb;while(a6&&a6.parentNode!=a7){a6=a6.parentNode}if(a6){return a9-E(a6)-1}var ba=v.commonAncestor(bb,a7);var bc=bb;while(bc&&bc.parentNode!=ba){bc=bc.parentNode}if(!bc){bc=ba}var a8=a7;while(a8&&a8.parentNode!=ba){a8=a8.parentNode}if(!a8){a8=ba}if(bc==a8){return 0}return E(a8)-E(bc)}function G(a7,a8){function a6(ba){try{return q(ba.startContainer,ba.endContainer,ba.startOffset,ba.endOffset)<0}catch(a9){return true}}if(a6(a7)){if(a8){a7.commonAncestorContainer=a7.endContainer=a7.startContainer;a7.endOffset=a7.startOffset}else{a7.commonAncestorContainer=a7.startContainer=a7.endContainer;a7.startOffset=a7.endOffset}a7.collapsed=true}}function a1(a7){a7.collapsed=a7.startContainer==a7.endContainer&&a7.startOffset==a7.endOffset;var a6=a7.startContainer;while(a6&&a6!=a7.endContainer&&!ai(a6,a7.endContainer)){a6=a6.parentNode}a7.commonAncestorContainer=a6}function s(a6){if(a.browser.msie&&a.browser.version<9){return new a2(a6)}return a6.createRange()}function aG(a6){a.extend(this,{range:a6,_current:null,_next:null,_end:null});if(a6.collapsed){return}var a7=a6.commonAncestorContainer;this._next=a6.startContainer==a7&&!ak(a6.startContainer)?a6.startContainer.childNodes[a6.startOffset]:D(a7,a6.startContainer);this._end=a6.endContainer==a7&&!ak(a6.endContainer)?a6.endContainer.childNodes[a6.endOffset]:D(a7,a6.endContainer).nextSibling}aG.prototype={hasNext:function(){return !!this._next},next:function(){var a6=this._current=this._next;this._next=this._current&&this._current.nextSibling!=this._end?this._current.nextSibling:null;if(ak(this._current)){if(this.range.endContainer==this._current){(a6=a6.cloneNode(true)).deleteData(this.range.endOffset,a6.length-this.range.endOffset)}if(this.range.startContainer==this._current){(a6=a6.cloneNode(true)).deleteData(0,this.range.startOffset)}}return a6},traverse:function(a6){function a8(){this._current=this._next;this._next=this._current&&this._current.nextSibling!=this._end?this._current.nextSibling:null;return this._current}var a7;while(a7=a8.call(this)){if(this.hasPartialSubtree()){this.getSubtreeIterator().traverse(a6)}else{a6(a7)}}return a7},remove:function(bb){var a9=this.range.startContainer==this._current;var a8=this.range.endContainer==this._current;if(ak(this._current)&&(a9||a8)){var bd=a9?this.range.startOffset:0;var a7=a8?this.range.endOffset:this._current.length;var a6=a7-bd;if(bb&&(a9||a8)){if(this._current==bb.startContainer&&bd<=bb.startOffset){bb.startOffset-=a6}if(this._current==bb.endContainer&&a7<=bb.endOffset){bb.endOffset-=a6}}this._current.deleteData(bd,a6)}else{var bc=this._current.parentNode;if(bb&&(this.range.startContainer==bc||this.range.endContainer==bc)){var ba=E(this._current);if(bc==bb.startContainer&&ba<=bb.startOffset){bb.startOffset-=1}if(bc==bb.endContainer&&ba0&&a7.previousSibling);a6.setEndPoint(ba?"EndToStart":"EndToEnd",bc);var bb=a7.nextSibling;if(!bb){bb=a7.previousSibling;if(bb&&ak(bb)){a9.setEnd(bb,bb.nodeValue.length);v.remove(a7)}else{a9.selectNodeContents(a8);v.remove(a7);a9.endOffset-=1}return}v.remove(a7);if(ak(bb)){a9[ba?"setStart":"setEnd"](bb,a6.text.length)}else{a9[ba?"setStartBefore":"setEndBefore"](bb)}}function aF(a6){this.enumerate=function(){var a7=[];function a8(a9){if(v.is(a9,"img")||(a9.nodeType==3&&!v.isWhitespace(a9))){a7.push(a9)}else{a9=a9.firstChild;while(a9){a8(a9);a9=a9.nextSibling}}}new aG(a6).traverse(a8);return a7}}function aV(a6){return new aF(a6).enumerate()}function k(ba){var a7=[];for(var a8=0,a9=ba.length;a8'}bb.selectNodeContents(a7)}}bb.collapse(true)};this.add=function(a8,a7){if(a7&&a8.collapsed){this.addCaret(a8);a8=aH.expand(a8)}var a9=a8.cloneRange();a9.collapse(false);this.end=v.create(u(a8),"span",{className:"t-marker"});a9.insertNode(this.end);a9=a8.cloneRange();a9.collapse(true);this.start=this.end.cloneNode(true);a9.insertNode(this.start);a8.setStartBefore(this.start);a8.setEndAfter(this.end);az(a8.commonAncestorContainer);return a8};this.remove=function(be){var bh=this.start,a9=this.end;az(be.commonAncestorContainer);while(!bh.nextSibling&&bh.parentNode){bh=bh.parentNode}while(!a9.previousSibling&&a9.parentNode){a9=a9.parentNode}var bg=(bh.previousSibling&&bh.previousSibling.nodeType==3)&&(bh.nextSibling&&bh.nextSibling.nodeType==3);var bf=(a9.previousSibling&&a9.previousSibling.nodeType==3)&&(a9.nextSibling&&a9.nextSibling.nodeType==3);bh=bh.nextSibling;a9=a9.previousSibling;var a7=false;var a8=false;if(bh==this.end){a8=!!this.start.previousSibling;bh=a9=this.start.previousSibling||this.end.nextSibling;a7=true}v.remove(this.start);v.remove(this.end);if(bh==null||a9==null){be.selectNodeContents(be.commonAncestorContainer);be.collapse(true);return}var bj=a7?ak(bh)?bh.nodeValue.length:bh.childNodes.length:0;var bb=ak(a9)?a9.nodeValue.length:a9.childNodes.length;if(bh.nodeType==3){while(bh.previousSibling&&bh.previousSibling.nodeType==3){bh=bh.previousSibling;bj+=bh.nodeValue.length}}if(a9.nodeType==3){while(a9.previousSibling&&a9.previousSibling.nodeType==3){a9=a9.previousSibling;bb+=a9.nodeValue.length}}var bi=E(bh),bk=bh.parentNode;var ba=E(a9),bc=a9.parentNode;for(var bl=bh;bl.previousSibling;bl=bl.previousSibling){if(bl.nodeType==3&&bl.previousSibling.nodeType==3){bi--}}for(var bd=a9;bd.previousSibling;bd=bd.previousSibling){if(bd.nodeType==3&&bd.previousSibling.nodeType==3){ba--}}az(bk);if(bh.nodeType==3){bh=bk.childNodes[bi]}az(bc);if(a9.nodeType==3){a9=bc.childNodes[ba]}if(a7){if(bh.nodeType==3){be.setStart(bh,bj)}else{be[a8?"setStartAfter":"setStartBefore"](bh)}be.collapse(true)}else{if(bh.nodeType==3){be.setStart(bh,bj)}else{be.setStartBefore(bh)}if(a9.nodeType==3){be.setEnd(a9,bb)}else{be.setEndAfter(a9)}}if(a6){this.removeCaret(be)}}}var l=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/;var aH={nodes:function(a7){var a6=aV(a7);if(!a6.length){a7.selectNodeContents(a7.commonAncestorContainer);a6=aV(a7);if(!a6.length){a6=v.significantChildNodes(a7.commonAncestorContainer)}}return a6},image:function(a7){var a6=[];new aG(a7).traverse(function(a8){if(v.is(a8,"img")){a6.push(a8)}});if(a6.length==1){return a6[0]}},expand:function(ba){var bb=ba.cloneRange();var bc=bb.startContainer.childNodes[bb.startOffset==0?0:bb.startOffset-1];var a8=bb.endContainer.childNodes[bb.endOffset];if(!ak(bc)||!ak(a8)){return bb}var a7=bc.nodeValue;var a6=a8.nodeValue;if(a7==""||a6==""){return bb}var bd=a7.split("").reverse().join("").search(l);var a9=a6.search(l);if(bd==0||a9==0){return bb}a9=a9==-1?a6.length:a9;bd=bd==-1?0:a7.length-bd;bb.setStart(bc,bd);bb.setEnd(a8,a9);return bb},isExpandable:function(bb){var ba=bb.startContainer;var a8=u(bb);if(ba==a8||ba==a8.body){return false}var bc=bb.cloneRange();var be=ba.nodeValue;if(!be){return false}var a7=be.substring(0,bc.startOffset);var a6=be.substring(bc.startOffset);var bd=0,a9=0;if(a7!=""){bd=a7.split("").reverse().join("").search(l)}if(a6!=""){a9=a6.search(l)}return bd!=0&&a9!=0}};function p(a7){var a8=new aI(a7.range);var a6=new aw();this.formatter=a7.formatter;this.getRange=function(){return a8.toRange()};this.lockRange=function(a9){return a6.add(this.getRange(),a9)};this.releaseRange=function(a9){a6.remove(a9);aO(a9)};this.undo=function(){a8.body.innerHTML=a8.html;aO(a8.toRange())};this.redo=function(){this.exec()};this.exec=function(){var a9=this.lockRange(true);this.formatter.editor=this.editor;this.formatter.toggle(a9);this.releaseRange(a9)}}function P(a8,a7){var a6=a8.body;this.redo=function(){a6.innerHTML=a7.html;aO(a7.toRange())};this.undo=function(){a6.innerHTML=a8.html;aO(a8.toRange())}}function ag(a6){p.call(this,a6);this.managesUndoRedo=true;this.exec=function(){var a7=this.editor;var a8=a7.getRange();var a9=new aI(a8);a7.clipboard.paste(a6.value||"");a7.undoRedoStack.push(new P(a9,new aI(a7.getRange())));a7.focus()}}function ah(){aW.call(this);this.command=function(a6){return new ag(a6)};this.update=function(a6,a7){a6.data("tSelectBox").close()};this.init=function(a6,a8){var a7=a8.editor;a6.tSelectBox({data:a7.insertHtml,onItemCreate:function(a9){a9.html=''+a9.dataItem.Text+""},onChange:function(a9){aW.exec(a7,"insertHtml",a9.value)},highlightFirst:false}).find(".t-input").html(a7.localization.insertHtml)}}function aY(){var a7=[],a6=-1;this.push=function(a8){a7=a7.slice(0,a6+1);a6=a7.push(a8)-1};this.undo=function(){if(this.canUndo()){a7[a6--].undo()}};this.redo=function(){if(this.canRedo()){a7[++a6].redo()}};this.canUndo=function(){return a6>=0};this.canRedo=function(){return a6!=a7.length-1}}function aX(a6){this.keydown=function(a7){var a9=a6.keyboard;var a8=a9.isTypingKey(a7);if(a8&&!a9.typingInProgress()){var ba=a6.getRange();this.startRestorePoint=new aI(ba);a9.startTyping(a.proxy(function(){a6.selectionRestorePoint=this.endRestorePoint=new aI(a6.getRange());a6.undoRedoStack.push(new P(this.startRestorePoint,this.endRestorePoint))},this));return true}return false};this.keyup=function(a7){var a8=a6.keyboard;if(a8.typingInProgress()){a8.endTyping();return true}return false}}function aU(a6){var a7=false;this.createUndoCommand=function(){this.endRestorePoint=new aI(a6.getRange());a6.undoRedoStack.push(new P(this.startRestorePoint,this.endRestorePoint));this.startRestorePoint=this.endRestorePoint};this.changed=function(){if(this.startRestorePoint){return this.startRestorePoint.html!=a6.body.innerHTML}return false};this.keydown=function(a8){var a9=a6.keyboard;if(a9.isModifierKey(a8)){if(a9.typingInProgress()){a9.endTyping(true)}this.startRestorePoint=new aI(a6.getRange());return true}if(a9.isSystem(a8)){a7=true;if(this.changed()){a7=false;this.createUndoCommand()}return true}return false};this.keyup=function(a8){if(a7&&this.changed()){a7=false;this.createUndoCommand(a8);return true}return false}}function al(a6){var bc=false;var bb;var a9;function a7(bd){return(bd>=48&&bd<=90)||(bd>=96&&bd<=111)||(bd>=186&&bd<=192)||(bd>=219&&bd<=222)}this.toolFromShortcut=function(bh,bd){var be=String.fromCharCode(bd.keyCode);for(var bg in bh){var bf=bh[bg];if((bf.key==be||bf.key==bd.keyCode)&&!!bf.ctrl==bd.ctrlKey&&!!bf.alt==bd.altKey&&!!bf.shift==bd.shiftKey){return bg}}};this.isTypingKey=function(bd){var be=bd.keyCode;return(a7(be)&&!bd.ctrlKey&&!bd.altKey)||be==32||be==13||be==8||(be==46&&!bd.shiftKey&&!bd.ctrlKey&&!bd.altKey)};this.isModifierKey=function(bd){var be=bd.keyCode;return(be==17&&!bd.shiftKey&&!bd.altKey)||(be==16&&!bd.ctrlKey&&!bd.altKey)||(be==18&&!bd.ctrlKey&&!bd.shiftKey)};this.isSystem=function(bd){return bd.keyCode==46&&bd.ctrlKey&&!bd.altKey&&!bd.shiftKey};this.startTyping=function(bd){a9=bd;bc=true};function ba(){bc=false;if(a9){a9()}}this.endTyping=function(bd){this.clearTimeout();if(bd){ba()}else{bb=window.setTimeout(ba,1000)}};this.typingInProgress=function(){return bc};this.clearTimeout=function(){window.clearTimeout(bb)};function a8(bd,bf){for(var be=0;be(\s| )*)+(<\/?(div|p|li|col|t))/ig,"$3");bg=bg.replace(/<(a|span)[^>]*><\/\1>/ig,"")}bg=bg.replace(/^

  • $/g,"li>");var bb=a9(bg);var bl=a7.getRange();bl.deleteContents();if(bl.startContainer==a7.document){bl.selectNodeContents(a7.body)}var bj=new aw();var bc=bj.addCaret(bl);var bk=ba(bb,bc);var bm=false;if(!/body|td/.test(v.name(bk))&&(bb||v.isInline(bk))){bl.selectNode(bc);aP(bl,bk,true);bm=true}var be=a8(bg);if(be.firstChild&&be.firstChild.className==="t-paste-container"){var bf=[];for(bh=0,bi=be.childNodes.length;bh"))}bl.insertNode(be);bk=ba(bb,bc);if(bm){while(bc.parentNode!=bk){v.unwrap(bc.parentNode)}v.unwrap(bc.parentNode)}az(bl.commonAncestorContainer);bc.style.display="inline";v.scrollTo(bc);bj.removeCaret(bl);aO(bl)}}function ax(){var a8=[//g,"",/"/g,"'",/(?:
     [\s\r\n]+|
    )*(<\/?(h[1-6]|hr|p|div|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|address|pre|form|blockquote|dl|dt|dd|dir|fieldset)[^>]*>)(?:
     [\s\r\n]+|
    )*/g,"$1",/

    /g,"

    ",/
    /g," ",/

    /g,"
    ",/^\s*( )+/gi,"",/( |]*>)+\s*$/gi,"",/mso-[^;"]*;?/ig,"",/<(\/?)b(\s[^>]*)?>/ig,"<$1strong$2>",/<(\/?)i(\s[^>]*)?>/ig,"<$1em$2>",/<\/?(meta|link|style|o:|v:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:)[^>]*>)?/ig,"",/style=(["|'])\s*\1/g,""];this.applicable=function(ba){return/class="?Mso|style="[^"]*mso-/i.test(ba)};function a7(ba){if(/^[\u2022\u00b7\u00a7\u00d8o]\u00a0+/.test(ba)){return"ul"}if(/^\s*\w+[\.\)]\u00a0{2,}/.test(ba)){return"ol"}}function a6(bc){var bm=v.create(document,"div",{innerHTML:bc});var ba=a(g.join(","),bm);var bf=-1,bg,bh={ul:{},ol:{}},bi=bm;for(var bd=0;bd]*>/g,"").replace(/ /g,"\u00a0");var bn=a7(bc);if(!bn||v.name(bl)!="p"){if(bl.innerHTML==""){v.remove(bl)}else{bh={ul:{},ol:{}};bi=bm;bf=-1}continue}var bk=parseFloat(bl.style.marginLeft||0);var bj=bh[bn][bk];if(bk>bf||!bj){bj=v.create(document,bn);if(bi==bm){v.insertBefore(bj,bl)}else{bi.appendChild(bj)}bh[bn][bk]=bj}if(bg!=bn){for(var be in bh){for(var bb in bh[be]){if(a.contains(bj,bh[be][bb])){delete bh[be][bb]}}}}v.remove(bl.firstChild);bi=v.create(document,"li",{innerHTML:bl.innerHTML});bj.appendChild(bi);v.remove(bl);bf=bk;bg=bn}return bm.innerHTML}function a9(ba){return ba.replace(/]*)>\s*<\/a>/ig,function(bb,bc){if(!bc||bc.indexOf("href")<0){return""}return bb})}this.clean=function(ba){for(var bb=0,bc=a8.length;bb]*"?/ig,"");return ba}}function ac(a6){function a7(bc){var bd=0,a8=0,a9=0,bb=bc.parentNode;for(var ba=bb.firstChild;ba;ba=ba.nextSibling){if(ba!=bc){if(ba.className=="t-marker"){a9++}else{if(ba.nodeType==3){bd++}else{a8++}}}}if(a9>1&&bb.firstChild.className=="t-marker"&&bb.lastChild.className=="t-marker"){return 0}else{return a8+bd}}this.findSuitable=function(a9,a8){if(!a8&&a7(a9)>0){return null}return v.parentOfType(a9,a6[0].tags)};this.findFormat=function(bb){for(var a9=0;a90){this.activate(bc,bb)}};this.apply=function(bg){var bc=[];for(var bd=0,be=bg.length;bd0){for(var bc=0,bd=be.length;bc1){var bc=bd.pop();var bb=bd[bd.length-1];if(bc.previousSibling&&bc.previousSibling.className=="t-marker"){bb.appendChild(bc.previousSibling)}if(bc.tagName==bb.tagName&&bc.previousSibling==bb&&bc.style.cssText==bb.style.cssText){while(bc.firstChild){bb.appendChild(bc.firstChild)}v.remove(bc)}}}}function T(a6,a9){ac.call(this,a6);function a8(bj){var bb=bj.attributes,bn=a.trim;if(!bb){return}for(var bf=0,bg=bb.length;bf=0?v.toHex(bo):bo}}}}return}function a7(bd){var ba=a(ak(bd)?bd.parentNode:bd);var be=ba.parents().andSelf();for(var bb=0,bc=be.length;bb'+bd.dataItem.Text+""},highlightFirst:false});ba.data(a9).value("inherit")}}function o(a7){aW.call(this,a7);var a6=[{tags:ab}];this.update=function(a8){a8.data("tColorPicker").close()};this.command=function(a8){return new M(a.extend(a8,{formatter:function(){var a9={};a9[a7.domAttr]=a8.value;return new U(a6,{style:a9},a7.cssAttr)}}))};this.willDelayExecution=af;this.init=function(a8,ba){var a9=ba.editor;a8.tColorPicker({selectedColor:"#000000",onChange:function(bb){aW.exec(a9,a7.name,bb.value)}})}}function aT(){aW.call(this);var a7=[{tags:["span"]}],a6=new T(a7,"className");this.command=function(a8){return new M(a.extend(a8,{formatter:function(){return new U(a7,{className:a8.value})}}))};this.update=function(a8,ba){var a9=a8.data("tSelectBox");a9.close();a9.value(a6.getFormat(ba))};this.init=function(a8,ba){var a9=ba.editor;a8.tSelectBox({data:a9.style,title:a9.localization.style,onItemCreate:function(bb){var bc=v.inlineStyle(a9.document,"span",{className:bb.dataItem.Value});bb.html=''+bb.html+""},onChange:function(bb){aW.exec(a9,"style",bb.value)}})}}function h(a7){function a6(bb,a9){for(var ba=0;ba'+ba.dataItem.Text+""},onChange:function(ba){aW.exec(a8,"formatBlock",ba.value)},highlightFirst:false})}}function aC(a6){p.call(this,a6);this.exec=function(){var bj=this.getRange(),a9=u(bj),bh,bi,bf,ba=a.browser.msie?"":'
    ',bg,be,bd,bc,bk,a7="p,h1,h2,h3,h4,h5,h6".split(","),bm=v.parentOfType(bj.startContainer,a7),bb=v.parentOfType(bj.endContainer,a7),bl=(bm&&!bb)||(!bm&&bb);bj.deleteContents();be=v.create(a9,"a");bj.insertNode(be);az(be.parentNode);bd=v.parentOfType(be,["li"]);bc=v.parentOfType(be,"h1,h2,h3,h4,h5,h6".split(","));if(bd){bk=bj.cloneRange();bk.selectNode(bd);if(aV(bk).length==0){bg=v.create(a9,"p");if(bd.nextSibling){aP(bk,bd.parentNode)}v.insertAfter(bg,bd.parentNode);v.remove(bd.parentNode.childNodes.length==1?bd.parentNode:bd);bg.innerHTML=ba;bf=bg}}else{if(bc&&!be.nextSibling){bg=v.create(a9,"p");v.insertAfter(bg,bc);bg.innerHTML=ba;v.remove(be);bf=bg}}if(!bf){if(!(bd||bc)){new i([{tags:["p"]}]).apply([be])}bj.selectNode(be);bh=v.parentOfType(be,[bd?"li":bc?v.name(bc):"p"]);aP(bj,bh,bl);bi=bh.previousSibling;if(v.is(bi,"li")&&bi.firstChild&&!v.is(bi.firstChild,"br")){bi=bi.firstChild}bf=bh.nextSibling;if(v.is(bf,"li")&&bf.firstChild&&!v.is(bf.firstChild,"br")){bf=bf.firstChild}v.remove(bh);function a8(bn){if(bn.firstChild&&v.is(bn.firstChild,"br")){v.remove(bn.firstChild)}if(ak(bn)&&bn.nodeValue==""){bn=bn.parentNode}if(bn&&!v.is(bn,"img")&&bn.innerHTML==""){bn.innerHTML=ba}}a8(bi);a8(bf);az(bi)}az(bf);if(v.is(bf,"img")){bj.setStartBefore(bf)}else{bj.selectNodeContents(bf)}bj.collapse(true);v.scrollTo(bf);aO(bj)}}function ay(a6){p.call(this,a6);this.exec=function(){var a9=this.getRange();a9.deleteContents();var a7=v.create(u(a9),"br");a9.insertNode(a7);az(a7.parentNode);if(!a.browser.msie&&(!a7.nextSibling||v.isWhitespace(a7.nextSibling))){var a8=a7.cloneNode(true);a8.setAttribute("_moz_dirty","");v.insertAfter(a8,a7)}a9.setStartAfter(a7);a9.collapse(true);aO(a9)}}function aq(a6){var a7=[a6=="ul"?"ol":"ul",a6];h.call(this,[{tags:a7}]);this.isFormatted=function(bb){var a9=[],a8;for(var ba=0;ba1){v.insertAfter(ba[ba.length-1],a6);v.insertAfter(ba[1],a6);v[bb.length>0?"insertBefore":"insertAfter"](ba[0],a6)}}else{var a9=new ad([{tags:["a"]}],a7);a9.finder=this.finder;a9.apply(bb)}}}function aZ(a6){a6.formatter={toggle:function(a7){new ad([{tags:["a"]}]).remove(aV(a7))}};p.call(this,a6)}function am(a8){p.call(this,a8);var a6;this.async=true;var a7=new ao();this.exec=function(){var bg=this.getRange();var bc=bg.collapsed;bg=this.lockRange(true);var bf=aV(bg);var be=null;var bh=this;function ba(bj){var bk=a("#t-editor-link-url",bd.element).val();if(bk&&bk!="http://"){a6={href:bk};var bn=a("#t-editor-link-title",bd.element).val();if(bn){a6.title=bn}var bm=a("#t-editor-link-text",bd.element).val();if(bm!==be){a6.innerHTML=bm}var bl=a("#t-editor-link-target",bd.element).is(":checked");if(bl){a6.target="_blank"}a7.apply(bg,a6)}bb(bj);if(bh.change){bh.change()}}function bb(bj){bj.preventDefault();bd.destroy();a5(u(bg)).focus();bh.releaseRange(bg)}var a9=bf.length?a7.finder.findSuitable(bf[0]):null;var bi=bf.length<=1||(bf.length==2&&bc);var bd=b.window.create(a.extend({},this.editor.dialogOptions,{title:"Insert link",html:new a.telerik.stringBuilder().cat('
    ').cat("
      ").cat('
    1. ').catIf('
    2. ',bi).cat('
    3. ').cat('
    4. ').cat("
    ").cat('
    ').cat('').cat(" or ").cat('Close').cat("
    ").cat("
    ").string(),onClose:bb})).hide().find(".t-dialog-insert").click(ba).end().find(".t-dialog-close").click(bb).end().find(".t-form-text-row input").keydown(function(bj){if(bj.keyCode==13){ba(bj)}else{if(bj.keyCode==27){bb(bj)}}}).end().find("#t-editor-link-url").val(a9?a9.getAttribute("href",2):"http://").end().find("#t-editor-link-text").val(bf.length>0?(bf.length==1?bf[0].nodeValue:bf[0].nodeValue+bf[1].nodeValue):"").end().find("#t-editor-link-title").val(a9?a9.title:"").end().find("#t-editor-link-target").attr("checked",a9?a9.target=="_blank":false).end().show().data("tWindow").center();if(bi&&bf.length>0){be=a("#t-editor-link-text",bd.element).val()}a("#t-editor-link-url",bd.element).focus().select()},this.redo=function(){var a9=this.lockRange(true);a7.apply(a9,a6);this.releaseRange(a9)}}function a0(a7){aW.call(this,a.extend(a7,{command:aZ}));var a6=new ac([{tags:["a"]}]);this.init=function(a8){a8.attr("unselectable","on").addClass("t-state-disabled")};this.update=function(a8,a9){a8.toggleClass("t-state-disabled",!a6.isFormatted(a9)).removeClass("t-state-hover")}}function V(a8){p.call(this,a8);this.async=true;var a6;function a7(a9,ba){if(a6.src&&a6.src!="http://"){if(!a9){a9=v.create(u(ba),"img",a6);a9.onload=a9.onerror=function(){a9.removeAttribute("complete");a9.removeAttribute("width");a9.removeAttribute("height")};ba.deleteContents();ba.insertNode(a9);ba.setStartAfter(a9);ba.setEndAfter(a9);aO(ba);return true}else{v.attr(a9,a6)}}return false}this.redo=function(){var a9=this.lockRange();if(!a7(aH.image(a9),a9)){this.releaseRange(a9)}};this.exec=function(){var bg=this.lockRange();var ba=false;var bf=aH.image(bg);var bh=this;function bb(bj){a6={src:a("#t-editor-image-url",bd.element).val(),alt:a("#t-editor-image-title",bd.element).val()};ba=a7(bf,bg);bc(bj);if(bh.change){bh.change()}}function bc(bj){bj.preventDefault();bd.destroy();a5(u(bg)).focus();if(!ba){bh.releaseRange(bg)}}var be=this.editor.fileBrowser;var bi=be&&be.selectUrl!==undefined;function a9(){if(bi){new b.imageBrowser(a(this).find(".t-image-browser"),a.extend(be,{apply:bb,element:bh.editor.element,localization:bh.editor.localization}))}}var bd=b.window.create(a.extend({width:750},this.editor.dialogOptions,{title:"Insert image",html:new a.telerik.stringBuilder().cat('
    ').catIf('
    ',bi).cat("
      ").cat('
    1. ').cat('
    2. ').cat("
    ").cat('
    ').cat('').cat(" or ").cat('Close').cat("
    ").cat("
    ").string(),onClose:bc,onActivate:a9})).hide().find(".t-dialog-insert").click(bb).end().find(".t-dialog-close").click(bc).end().find(".t-form-text-row input").keydown(function(bj){if(bj.keyCode==13){bb(bj)}else{if(bj.keyCode==27){bc(bj)}}}).end().toggleClass("t-imagebrowser",bi).find("#t-editor-image-url").val(bf?bf.getAttribute("src",2):"http://").end().find("#t-editor-image-title").val(bf?bf.alt:"").end().show().data("tWindow").center();a("#t-editor-image-url",bd.element).focus().select()}}b.selectbox=function(a9,bb){var bd;var a6=a(a9).attr("tabIndex",0);var a7=a6.find(".t-input");var a8=this.dropDown=new b.dropDown({effects:b.fx.slide.defaults(),onItemCreate:bb.onItemCreate,onClick:function(bf){bc(bb.data[a(bf.item).index()].Value);bb.onChange({value:bd})}});function ba(){if(!a8.$items){a8.dataBind(bb.data)}}function be(bf){a7.html(bf?bf:" ")}function bc(bh){ba();var bg=-1;for(var bf=0,bi=bb.data.length;bf0?"rtl":"");a(document.documentElement).bind("mousedown",a.proxy(function(bg){var bf=a8.$element;var bh=bf&&bf.parent().length>0;if(bh&&!a.contains(a9,bg.target)&&!a.contains(bf.parent()[0],bg.target)){a8.close()}},this))};a.fn.tSelectBox=function(a6){return b.create(this,{name:"tSelectBox",init:function(a7,a8){return new b.selectbox(a7,a8)},options:a6})};a.fn.tSelectBox.defaults={effects:b.fx.slide.defaults()};b.colorpicker=function(a7,a8){var a9=this;a9.element=a7;var a6=a(a7);a.extend(a9,a8);a6.attr("tabIndex",0).click(a.proxy(a9.click,a9)).keydown(function(ba){var bc=a9.popup(),be,bb,bd;if(ba.keyCode==40){if(!bc.is(":visible")){a9.open()}else{be=bc.find(".t-state-selected");if(be[0]){bb=be.next()}else{bb=bc.find("li:first")}if(bb[0]){be.removeClass("t-state-selected");bb.addClass("t-state-selected")}}ba.preventDefault()}else{if(ba.keyCode==38){if(bc.is(":visible")){be=bc.find(".t-state-selected");bd=be.prev();if(bd[0]){be.removeClass("t-state-selected");bd.addClass("t-state-selected")}}ba.preventDefault()}else{if(ba.keyCode==9||ba.keyCode==39||ba.keyCode==37){a9.close()}else{if(ba.keyCode==13){bc.find(".t-state-selected").click();ba.preventDefault()}}}}}).find("*").attr("unselectable","on");if(a.browser.msie){a6.focus(function(){a6.css("outline","1px dotted #000")}).blur(function(){a6.css("outline","")})}if(a9.selectedColor){a6.find(".t-selected-color").css("background-color",this.selectedColor)}a(a7.ownerDocument.documentElement).bind("mousedown",a.proxy(function(ba){if(!a(ba.target).closest(".t-colorpicker-popup").length){this.close()}},a9));b.bind(a9,{change:a9.onChange,load:a9.onLoad})};b.colorpicker.prototype={select:function(a6){if(a6){a6=v.toHex(a6);if(!b.trigger(this.element,"change",{value:a6})){this.value(a6);this.close()}}else{b.trigger(this.element,"change",{value:this.selectedColor})}},open:function(){var a7=this.popup();var a6=a(this.element);var a8=a6.offset();a8.top+=a6.outerHeight();if(a6.closest(".t-rtl").length){a8.left-=a7.outerWidth()-a6.outerWidth()}var a9="auto";a6.parents().andSelf().each(function(){a9=a(this).css("zIndex");if(Number(a9)){a9=Number(a9)+1;return false}});b.fx._wrap(a7).css(a.extend({position:"absolute",zIndex:a9},a8));a7.find(".t-item").bind("click",a.proxy(function(bb){var ba=a(bb.currentTarget,bb.target.ownerDocument).find("div").css("background-color");this.select(ba)},this));b.fx.play(this.effects,a7,{direction:"bottom"})},close:function(){if(!this.$popup){return}b.fx.rewind(this.effects,this.$popup,{direction:"bottom"},a.proxy(function(){v.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(a6){if(a(a6.target).closest(".t-tool-icon").length>0){this.select()}else{this.toggle()}},value:function(a6){if(!a6){return this.selectedColor}a6=v.toHex(a6);this.selectedColor=a6;a(".t-selected-color",this.element).css("background-color",a6)},popup:function(){if(!this.$popup){this.$popup=a(b.colorpicker.buildPopup(this)).hide().appendTo(document.body).find("*").attr("unselectable","on").end()}return this.$popup}};a.extend(b.colorpicker,{buildPopup:function(a6){var a9=new b.stringBuilder();a9.cat('
    ').cat('
      ');var a8=a6.data;var a7=(a6.value()||"").substring(1);for(var ba=0,bb=a8.length;ba
      ')}a9.cat("
    ");return a9.string()}});a.fn.tColorPicker=function(a6){return b.create(this,{name:"tColorPicker",init:function(a7,a8){return new b.colorpicker(a7,a8)},options:a6})};a.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:b.fx.slide.defaults()};function W(a6,a8){var a7=v.name(a6)!="td"?"marginLeft":"paddingLeft";if(a8===undefined){return a6.style[a7]||0}else{if(a8>0){a6.style[a7]=a8+"px"}else{a6.style[a7]="";if(a6.style.cssText==""){a6.removeAttribute("style")}}}}function Y(){var a6=new h([{tags:g}]);this.apply=function(bf){var ba=a6.findSuitable(bf);if(ba.length){var bh=[];for(var bc=0;bc1||W(bc[a8].parentNode)))||(v.ofType(bc[a8],["ul","ol"])&&ba>0)}if(a9){a7.removeClass("t-state-disabled");return}}a7.addClass("t-state-disabled").removeClass("t-state-hover")}}function aD(a6){this.editor=a6;this.formats=[]}aD.prototype={apply:function(bc){if(!this.hasPending()){return}var ba=new aw();ba.addCaret(bc);var a6=bc.startContainer.childNodes[bc.startOffset];var bd=a6.previousSibling;if(!bd.nodeValue){bd=bd.previousSibling}bc.setStart(bd,bd.nodeValue.length-1);ba.add(bc);if(aV(bc).length==0){ba.remove(bc);bc.collapse(true);this.editor.selectRange(bc);return}var be=ba.end.previousSibling.previousSibling;var bb,a8=this.formats;for(var a9=0;a90},isPending:function(a6){return !!this.getPending(a6)},getPending:function(a6){var a7=this.formats;for(var a8=0;a8",{src:'javascript:""',frameBorder:"0"}).css("display","").addClass("t-content").insertBefore(a6)[0];var bb=a9.contentWindow||a9;var a7=bb.document||a9.contentDocument;var a8=a6.val().replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/ig,"$1").replace(/[\r\n\v\f\t ]+/ig," ");if(!a8.length&&a.browser.mozilla){a8='
    '}a7.designMode="On";a7.open();a7.write(new b.stringBuilder().cat("").cat('').cat('").cat(a.map(ba,function(bc){return[''].join("")}).join("")).cat('').cat(a8).cat("").string());a7.close();return bb}function aK(a6){b.trigger(a6.element,"selectionChange")}var H=".t-colorpicker,a.t-tool-icon:not(.t-state-disabled),.t-selectbox, .t-combobox .t-input";function Z(a6){var a7=true;a6.window=r(a(a6.textarea),a6.stylesheets);a6.document=a6.window.contentDocument||a6.window.document;a6.body=a6.document.body;a(a6.document).bind({keydown:function(a8){if(a8.keyCode===121){setTimeout(function(){var bb=a(a6.element).attr("tabIndex");a(a6.element).attr("tabIndex",bb||0).focus().find(H).first().focus();if(!bb&&bb!==0){a(a6.element).removeAttr("tabIndex")}},100);a8.preventDefault();return}var ba=a6.keyboard.toolFromShortcut(a6.tools,a8);if(ba){a8.preventDefault();if(!/undo|redo/.test(ba)){a6.keyboard.endTyping(true)}a6.exec(ba);return false}if(a6.keyboard.isTypingKey(a8)&&a6.pendingFormats.hasPending()){if(a7){a7=false}else{var a9=a6.getRange();a6.pendingFormats.apply(a9);a6.selectRange(a9)}}a6.keyboard.clearTimeout();a6.keyboard.keydown(a8)},keyup:function(a8){var ba=[8,9,33,34,35,36,37,38,39,40,40,45,46];if(a.browser.mozilla&&a8.keyCode==8){F(a6,a8)}if(a.inArray(a8.keyCode,ba)>-1||(a8.keyCode==65&&a8.ctrlKey&&!a8.altKey&&!a8.shiftKey)){a6.pendingFormats.clear();aK(a6)}if(a6.keyboard.isTypingKey(a8)){if(a6.pendingFormats.hasPending()){var a9=a6.getRange();a6.pendingFormats.apply(a9);a6.selectRange(a9)}}else{a7=true}a6.keyboard.keyup(a8)},mousedown:function(a8){a6.pendingFormats.clear();var a9=a(a8.target);if(!a.browser.gecko&&a8.which==2&&a9.is("a[href]")){window.open(a9.attr("href"),"_new")}},mouseup:function(){aK(a6)}});a(a6.window).bind("blur",function(){var a8=a6.textarea.value,a9=a6.encodedValue();a6.update(a9);if(a9!=a8){b.trigger(a6.element,"change")}});a(a6.body).bind("cut paste",function(a8){a6.clipboard["on"+a8.type](a8)})}b.editor=function(ba,bd){if(/Mobile.*Safari/.test(navigator.userAgent)){return}var be=this;this.element=ba;var a6=a(ba);a6.closest("form").bind("submit",function(){be.update()});a.extend(this,bd);b.bind(this,{load:this.onLoad,selectionChange:this.onSelectionChange,change:this.onChange,execute:this.onExecute,error:this.onError,paste:this.onPaste});for(var bc in this.tools){this.tools[bc].name=bc.toLowerCase()}this.textarea=a6.find("textarea").attr("autocomplete","off")[0];Z(this);this.keyboard=new al([new aX(this),new aU(this)]);this.clipboard=new n(this);this.pendingFormats=new aD(this);this.undoRedoStack=new aY();function bg(bh){var bi=a.grep(bh.className.split(" "),function(bj){return !/^t-(widget|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(bj)});return bi[0]?bi[0].substring(2):"custom"}function a7(bh,bi){if(!bi.key){return bh}return new b.stringBuilder().cat(bh).cat(" (").catIf("Ctrl + ",bi.ctrl).catIf("Shift + ",bi.shift).catIf("Alt + ",bi.alt).cat(bi.key).cat(")").string()}var bf=".t-editor-toolbar > li > *",a8=".t-editor-button .t-tool-icon",bb=a8+":not(.t-state-disabled)",a9=a8+".t-state-disabled";a6.find(".t-combobox .t-input").keydown(function(bi){var bh=a(this).closest(".t-combobox").data("tComboBox"),bj=bi.keyCode;if(bj==39||bj==37){bh.close()}else{if(bj==40){if(!bh.dropDown.isOpened()){bi.stopImmediatePropagation();bh.open()}}}});a6.delegate(bb,"mouseenter",b.hover).delegate(bb,"mouseleave",b.leave).delegate(a8,"mousedown",b.preventDefault).delegate(H,"keydown",function(bh){if(bh.keyCode==39){a(this).closest("li").nextAll("li:has("+H+")").first().find(H).focus()}else{if(bh.keyCode==37){a(this).closest("li").prevAll("li:has("+H+")").last().find(H).focus()}else{if(bh.keyCode==27){be.focus()}}}}).delegate(bb,"click",b.stopAll(function(bh){be.exec(bg(this))})).delegate(a9,"click",function(bh){bh.preventDefault()}).find(bf).each(function(){var bl=bg(this),bk=be.tools[bl],bi=be.localization[bl],bh=a(this);if(!bk){return}if(bl=="fontSize"||bl=="fontName"){var bj=be.localization[bl+"Inherit"]||au[bl+"Inherit"];be[bl][0].Text=bj;bh.find("input").val(bj).end().find("span.t-input").text(bj).end()}bk.init(bh,{title:a7(bi,bk),editor:be})}).end().bind("selectionChange",function(){var bi=be.getRange();var bh=aV(bi);if(!bh.length){bh=[bi.startContainer]}a6.find(bf).each(function(){var bj=be.tools[bg(this)];if(bj){bj.update(a(this),bh,be.pendingFormats)}})});a(document).bind("DOMNodeInserted",function(bh){if(a.contains(bh.target,be.element)||be.element==bh.target){be.textarea.value=be.value();a(be.element).find("iframe").remove();Z(be)}}).bind("mousedown",function(bh){try{if(be.keyboard.typingInProgress()){be.keyboard.endTyping(true)}if(!be.selectionRestorePoint){be.selectionRestorePoint=new aI(be.getRange())}}catch(bh){}})};function F(a7,a6){var a9=a7.getRange(),ba=a9.startContainer;if(ba==a7.body.firstChild||!v.isBlock(ba)||(ba.childNodes.length>0&&!(ba.childNodes.length==1&&v.is(ba.firstChild,"br")))){return}var a8=ba.previousSibling;while(a8&&!v.isBlock(a8)){a8=a8.previousSibling}if(!a8){return}var bc=a7.document.createTreeWalker(a8,NodeFilter.SHOW_TEXT,null,false);var bb;while(bb=bc.nextNode()){a8=bb}a9.setStart(a8,ak(a8)?a8.nodeValue.length:0);a9.collapse(true);aO(a9);v.remove(ba);a6.preventDefault()}a.extend(b.editor,{BlockFormatFinder:h,BlockFormatter:i,Dom:v,FormatCommand:M,GenericCommand:P,GreedyBlockFormatter:S,GreedyInlineFormatFinder:T,GreedyInlineFormatter:U,ImageCommand:V,IndentCommand:X,IndentFormatter:Y,InlineFormatFinder:ac,InlineFormatter:ad,InsertHtmlCommand:ag,Keyboard:al,LinkCommand:am,LinkFormatFinder:an,LinkFormatter:ao,ListCommand:ap,ListFormatFinder:aq,ListFormatter:ar,MSWordFormatCleaner:ax,Marker:aw,NewLineCommand:ay,OutdentCommand:aA,ParagraphCommand:aC,PendingFormats:aD,RangeEnumerator:aF,RangeUtils:aH,RestorePoint:aI,SystemHandler:aU,TypingHandler:aX,UndoRedoStack:aY,UnlinkCommand:aZ});b.editor.prototype={value:function(a7){var a6=this.body;if(a7===undefined){return w(a6)}this.pendingFormats.clear();a7=a7.replace(//g,"");a7=a7.replace(/]*)>(.*)?<\/script>/ig,"$2");if(a.browser.mozilla){a7=a7.replace(/]*)>(\s*)?<\/p>/ig,'


    ')}if(a.browser.msie&&parseInt(a.browser.version)<9){a7="
    "+a7;var a9="originalsrc",a8="originalhref";a7=a7.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,a8+'="$1"');a7=a7.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,a9+'="$1"');a6.innerHTML=a7;v.remove(a6.firstChild);a(a6).find("telerik\\:script,script,link,img,a").each(function(){var ba=this;if(ba[a8]){ba.setAttribute("href",ba[a8]);ba.removeAttribute(a8)}if(ba[a9]){ba.setAttribute("src",ba[a9]);ba.removeAttribute(a9)}})}else{a6.innerHTML=a7;if(a.browser.msie){az(a6)}}this.selectionRestorePoint=null;this.update()},focus:function(){this.window.focus()},update:function(a6){this.textarea.value=a6||this.encoded?this.encodedValue():this.value()},encodedValue:function(){return v.encode(this.value())},createRange:function(a6){return s(a6||this.document)},getSelection:function(){return aL(this.document)},selectRange:function(a6){this.focus();var a7=this.getSelection();a7.removeAllRanges();a7.addRange(a6)},getRange:function(){var a7=this.getSelection();var a6=a7.rangeCount>0?a7.getRangeAt(0):this.createRange();if(a6.startContainer==this.document&&a6.endContainer==this.document&&a6.startOffset==0&&a6.endOffset==0){a6.setStart(this.body,0);a6.collapse(true)}return a6},selectedHtml:function(){return w(this.getRange().cloneContents())},paste:function(a6){this.clipboard.paste(a6)},exec:function(a9,ba){var bb,a6,a8,bc="";a9=a9.toLowerCase();if(!this.keyboard.typingInProgress()){this.focus();bb=this.getRange();a6=this.document.body}for(a8 in this.tools){if(a8.toLowerCase()==a9){bc=this.tools[a8];break}}if(bc){bb=this.getRange();if(!/undo|redo/i.test(a9)&&bc.willDelayExecution(bb)){this.pendingFormats.toggle({name:a9,params:ba,command:bc.command});aK(this);return}var a7=bc.command?bc.command(a.extend({range:bb},ba)):null;b.trigger(this.element,"execute",{name:a9,command:a7});if(/undo|redo/i.test(a9)){this.undoRedoStack[a9]()}else{if(a7){if(!a7.managesUndoRedo){this.undoRedoStack.push(a7)}a7.editor=this;a7.exec();if(a7.async){a7.change=a.proxy(function(){aK(this)},this);return}}}aK(this)}}};a.fn.tEditor=function(a6){return b.create(this,{name:"tEditor",init:function(a7,a8){return new b.editor(a7,a8)},options:a6})};var N={bold:[{tags:["strong"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}],italic:[{tags:["em"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}],underline:[{tags:["span"],attr:{style:{textDecoration:"underline"}}}],strikethrough:[{tags:["del"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}],justifyLeft:[{tags:g,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left"}}}],justifyCenter:[{tags:g,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto"}}}],justifyRight:[{tags:g,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right"}}}],justifyFull:[{tags:g,attr:{style:{textAlign:"justify"}}}]};function L(a8,a6){for(var a7=0;a7=0){return a6[a7]}}}function aW(a6){a.extend(this,a6);this.init=function(a7,a8){a7.attr({unselectable:"on",title:a8.title})};this.command=function(a7){return new a6.command(a7)};this.update=function(){};this.willDelayExecution=function(){return false}}aW.exec=function(a6,a7,a8){a6.exec(a7,{value:a8})};function O(a6){aW.call(this,a6);this.command=function(a7){return new M(a.extend(a7,{formatter:a6.formatter}))};this.update=function(a7,bb,bc){var ba=bc.isPending(this.name),a9=a6.finder.isFormatted(bb),a8=ba?!a9:a9;a7.toggleClass("t-state-active",a8)}}var y=function(){return{isFormatted:function(){return false}}};var au={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."};a.fn.tEditor.defaults={localization:au,formats:N,encoded:true,stylesheets:[],dialogOptions:{modal:true,resizable:false,draggable:true,effects:{list:[{name:"toggle"}]}},fontName:[{Text:au.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:au.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 ae({key:"B",ctrl:true,format:N.bold}),italic:new ae({key:"I",ctrl:true,format:N.italic}),underline:new ae({key:"U",ctrl:true,format:N.underline}),strikethrough:new ae({format:N.strikethrough}),undo:{key:"Z",ctrl:true},redo:{key:"Y",ctrl:true},insertLineBreak:new aW({key:13,shift:true,command:ay}),insertParagraph:new aW({key:13,command:aC}),justifyCenter:new j({format:N.justifyCenter}),justifyLeft:new j({format:N.justifyLeft}),justifyRight:new j({format:N.justifyRight}),justifyFull:new j({format:N.justifyFull}),insertUnorderedList:new at({tag:"ul"}),insertOrderedList:new at({tag:"ol"}),createLink:new aW({key:"K",ctrl:true,command:am}),unlink:new a0({key:"K",ctrl:true,shift:true}),insertImage:new aW({command:V}),indent:new aW({command:X}),outdent:new aB(),insertHtml:new ah(),style:new aT(),fontName:new J({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName"}),fontSize:new J({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize"}),formatBlock:new K(),foreColor:new o({cssAttr:"color",domAttr:"color",name:"foreColor"}),backColor:new o({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor"})}}})(jQuery);