(function(){CKEDITOR.plugins.add("vbremoveformat",{requires:["selection"],init:function(A){var B=A.addCommand("removeFormat",CKEDITOR.plugins.removeformat.commands.removeformat);B.modes={wysiwyg:1,enhancedsource:1};A.ui.addButton("RemoveFormat",{label:A.lang.removeFormat,command:"removeFormat"});A._.removeFormat={filters:[]}}});CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(G){if(G.mode=="wysiwyg"){var R=G._.removeFormatRegex||(G._.removeFormatRegex=new RegExp("^(?:"+G.config.removeFormatTags.replace(/,/g,"|")+")$","i"));var F=G._.removeAttributes||(G._.removeAttributes=G.config.removeFormatAttributes.split(","));var J=CKEDITOR.plugins.removeformat.filter;var C=G.getSelection().getRanges(1),Q=C.createIterator(),M;while((M=Q.getNextRange())){if(!M.collapsed){M.enlarge(CKEDITOR.ENLARGE_ELEMENT)}var H=M.createBookmark(),V=H.startNode,O=H.endNode,E;var L=function(a){var b=new CKEDITOR.dom.elementPath(a),X=b.elements;for(var Y=1,Z;Z=X[Y];Y++){if(Z.equals(b.block)||Z.equals(b.blockLimit)){break}if(R.test(Z.getName())&&J(G,Z)){a.breakParent(Z)}}};L(V);if(O){L(O);E=V.getNextSourceNode(true,CKEDITOR.NODE_ELEMENT);while(E){if(E.equals(O)){break}var D=E.getNextSourceNode(false,CKEDITOR.NODE_ELEMENT);if(!(E.getName()=="img"&&E.data("cke-realelement"))&&J(G,E)){if(R.test(E.getName())){E.remove(1)}else{E.removeAttributes(F);G.fire("removeFormatCleanup",E)}}E=D}}M.moveToBookmark(H)}G.getSelection().selectRanges(C)}else{var P=function(Y,Z,a){if(Y.setSelectionRange){Y.focus();Y.setSelectionRange(Z,a)}else{if(Y.createTextRange){var X=Y.createTextRange();X.collapse(true);X.moveEnd("character",a);X.moveStart("character",Z);X.select()}}};var S=function(X,Y){P(X,Y,Y)};var B=function(X,d,Y){var a="["+X+"=";var Z="[/"+X+"]";if(typeof Y=="undefined"){Y=-1}while((startindex=PHP.stripos(d,a))!==false&&Y!=0){Y--;if((stopindex=PHP.stripos(d,Z))!==false){var b=PHP.stripos(d,"]",startindex);if(b!==false&&b>startindex&&b<stopindex){var c=d.substr(b+1,stopindex-b-1);d=d.substr(0,startindex)+c+d.substr(stopindex+Z.length)}else{break}}else{break}}return d};var A=function(X,c,Y){var a="["+X+"]";var Z="[/"+X+"]";if(typeof Y=="undefined"){Y=-1}while((startindex=PHP.stripos(c,a))!==false&&Y!=0){Y--;if((stopindex=PHP.stripos(c,Z))!==false){var b=c.substr(startindex+a.length,stopindex-startindex-a.length);c=c.substr(0,startindex)+b+c.substr(stopindex+Z.length)}else{break}}return c};var I=function(a){var Y=new Array("b","i","u");var Z=new Array("font","color","size");if(!a){return a}var X;for(X in Y){if(YAHOO.lang.hasOwnProperty(Y,X)){a=A(Y[X],a)}}for(X in Z){if(YAHOO.lang.hasOwnProperty(Z,X)){a=B(Z[X],a)}}return a};var N=G.textarea.$;if(CKEDITOR.env.ie){N.focus();sel=document.selection.createRange();var K=sel.text;var U=I(K);sel.text=U;sel.moveStart("character",-U.length);sel.select()}else{if(N.selectionStart||N.selectionStart=="0"){var W=N.selectionStart;var T=N.selectionEnd;var K=N.value.substring(W,T);var U=I(K);N.value=N.value.substring(0,W)+U+N.value.substring(T,N.value.length);if(W==T){S(N,W)}else{P(N,W,W+U.length)}}}}}}},filter:function(C,B){var D=C._.removeFormat.filters;for(var A=0;A<D.length;A++){if(D[A](B)===false){return false}}return true}}})();CKEDITOR.editor.prototype.addRemoveFormatFilter=function(A){this._.removeFormat.filters.push(A)};CKEDITOR.config.removeFormatTags="b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var";CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign";