(function(){varc=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.is;tinymce.create("tinymce.plugins.Compat2x",{getInfo:function(){return{longname:"Compat2x",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/compat2x",version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}}});(function(){tinymce.extend(tinyMCE,{addToLang:function(f,e){d(e,function(h,g){tinyMCE.i18n[(tinyMCE.settings.language||"en")+"."+(f?f+"_":"")+g]=h})},getInstanceById:function(e){returnthis.get(e)}})})();(function(){vare=tinymce.EditorManager;tinyMCE.instances={};tinyMCE.plugins={};tinymce.PluginManager.onAdd.add(function(f,h,g){tinyMCE.plugins[h]=g});tinyMCE.majorVersion=tinymce.majorVersion;tinyMCE.minorVersion=tinymce.minorVersion;tinyMCE.releaseDate=tinymce.releaseDate;tinyMCE.baseURL=tinymce.baseURL;tinyMCE.isIE=tinyMCE.isMSIE=tinymce.isIE||tinymce.isOpera;tinyMCE.isMSIE5=tinymce.isIE;tinyMCE.isMSIE5_0=tinymce.isIE;tinyMCE.isMSIE7=tinymce.isIE;tinyMCE.isGecko=tinymce.isGecko;tinyMCE.isSafari=tinymce.isWebKit;tinyMCE.isOpera=tinymce.isOpera;tinyMCE.isMac=false;tinyMCE.isNS7=false;tinyMCE.isNS71=false;tinyMCE.compat=true;TinyMCE_Engine=tinyMCE;tinymce.extend(tinyMCE,{getParam:function(g,f){returnthis.activeEditor.getParam(g,f)},addEvent:function(i,g,h,j){tinymce.dom.Event.add(i,g,h,j||this)},getControlHTML:function(f){returne.activeEditor.controlManager.createControl(f)},loadCSS:function(f){tinymce.DOM.loadCSS(f)},importCSS:function(g,f){if(g==document){this.loadCSS(f)}else{newtinymce.dom.DOMUtils(g).loadCSS(f)}},log:function(){console.debug.apply(console,arguments)},getLang:function(h,g){varf=e.activeEditor.getLang(h.replace(/^lang_/g,""),g);if(/^[0-9\-.]+$/g.test(f)){returnparseInt(f)}returnf},isInstance:function(f){returnf!=null&&typeof(f)=="object"&&f.execCommand},triggerNodeChange:function(){e.activeEditor.nodeChanged()},regexpReplace:function(j,f,h,i){varg;if(j==null){returnj}if(typeof(i)=="undefined"){i="g"}g=newRegExp(f,i);returnj.replace(g,h)},trim:function(f){returntinymce.trim(f)},xmlEncode:function(f){returntinymce.DOM.encode(f)},explode:function(f,h){varg=[];tinymce.each(f.split(h),function(i){if(i!=""){g.push(i)}});returng},switchClass:function(h,g){varf;if(/^mceButton/.test(g)){f=e.activeEditor.controlManager.get(h);if(!f){return}switch(g){case"mceButtonNormal":f.setDisabled(false);f.setActive(false);return;case"mceButtonDisabled":f.setDisabled(true);return;case"mceButtonSelected":f.setActive(true);f.setDisabled(false);return}}},addCSSClass:function(g,h,f){returntinymce.DOM.addClass(g,h,f)},hasCSSClass:function(f,g){returntinymce.DOM.hasClass(f,g)},removeCSSClass:function(f,g){returntinymce.DOM.removeClass(f,g)},getCSSClasses:function(){varf=e.activeEditor.dom.getClasses(),g=[];d(f,function(h){g.push(h["class"])});returng},setWindowArg:function(g,f){e.activeEditor.windowManager.params[g]=f},getWindowArg:function(i,g){varh=e.activeEditor.windowManager,f;f=h.getParam(i);if(f===""){return""}returnf||h.getFeature(i)||g},getParentNode:function(h,g){returnthis._getDOM().getParent(h,g)},selectElements:function(o,k,m){varl,j=[],h,g;for(g=0,k=k.split(",");g<k.length;g++){for(l=0,h=o.getElementsByTagName(k[g]);l<h.length;l++){(!m||m(h[l]))&&j.push(h[l])}}returnj},getNodeTree:function(i,f,g,h){returnthis.selectNodes(i,function(j){return(!g||j.nodeType==g)&&(!h||j.nodeName==h)},f?f:[])},getAttrib:function(g,h,f){returnthis._getDOM().getAttrib(g,h,f)},setAttrib:function(g,h,f){returnthis._getDOM().setAttrib(g,h,f)},getElementsByAttributeValue:function(m,k,g,h){varj,f=m.getElementsByTagName(k),l=[];for(j=0;j<f.length;j++){if(tinyMCE.getAttrib(f[j],g).indexOf(h)!=-1){l[l.length]=f[j]}}returnl},selectNodes:function(k,j,g){varh;if(!g){g=[]}if(j(k)){g[g.length]=k}if(k.hasChildNodes()){for(h=0;h<k.childNodes.length;h++){tinyMCE.selectNodes(k.childNodes[h],j,g)}}returng},getContent:function(){returne.activeEditor.getContent()},getParentElement:function(i,g,h){if(g){g=newRegExp("^("+g.toUpperCase().replace(/,/g,"|")+")$","g")}returnthis._getDOM().getParent(i,function(f){returnf.nodeType==1&&(!g||g.test(f.nodeName))&&(!h||h(f))},this.activeEditor.getBody())},importPluginLanguagePack:function(f){tinymce.PluginManager.requireLangPack(f)},getButtonHTML:function(l,j,h,k,i,g){varf=e.activeEditor;h=h.replace(/\{\$pluginurl\}/g,tinyMCE.pluginURL);h=h.replace(/\{\$themeurl\}/g,tinyMCE.themeURL);j=j.replace(/^lang_/g,"");returnf.controlManager.createButton(l,{title:j,command:k,ui:i,value:g,scope:this,"class":"compat",image:h})},addSelectAccessibility:function(h,g,f){if(!g._isAccessible){g.onkeydown=tinyMCE.accessibleEventHandler;g.onblur=tinyMCE.accessibleEventHandler;g._isAccessible=true;g._win=f}returnfalse},accessibleEventHandler:function(g){varh,f=this._win;g=tinymce.isIE?f.event:g;h=tinymce.isIE?g.srcElement:g.target;if(g.type=="blur"){if(h.oldonchange){h.onchange=h.oldonchange;h.oldonchange=null}returntrue}if(h.nodeName=="SELECT"&&!h.oldonchange){h.oldonchange=h.onchange;h.onchange=null}if(g.keyCode==13||g.keyCode==32){h.onchange=h.oldonchange;h.onchange();h.oldonchange=null;tinyMCE.cancelEvent(g);returnfalse}returntrue},cancelEvent:function(f){returntinymce.dom.Event.cancel(f)},handleVisualAid:function(f){e.activeEditor.addVisual(f)},getAbsPosition:function(g,f){returntinymce.DOM.getPos(g,f)},cleanupEventStr:function(f){f=""+f;f=f.replace("function anonymous()\n{\n","");f=f.replace("\n}","");f=f.replace(/^return true;/gi,"");returnf},getVisualAidClass:function(f){returnf},parseStyle:function(f){returnthis._getDOM().parseStyle(f)},serializeStyle:function(f){returnthis._getDOM().serializeStyle(f)},openWindow:function(h,g){varf=e.activeEditor,i={},j;for(jinh){i[j]=h[j]}h=i;g=g||{};h.url=newtinymce.util.URI(tinymce.ThemeManager.themeURLs[f.settings.theme]).toAbsolute(h.file);h.inline=h.inline||g.inline;f.windowManager.open(h,g)},closeWindow:function(f){e.activeEditor.windowManager.close(f)},getOuterHTML:function(f){returntinymce.DOM.getOuterHTML(f)},setOuterHTML:function(g,f,i){returntinymce.DOM.setOuterHTML(g,f,i)},hasPlugin:function(f){returntinymce.PluginManager.get(f)!=null},_setEventsEnabled:function(){},addPlugin:function(g,i){varh=this;functionj(f){tinyMCE.selectedInstance=f;f.onInit.add(function(){h.settings=f.settings;h.settings.base_href=tinyMCE.documentBasePath;tinyMCE.settings=h.settings;tinyMCE.documentBasePath=f.documentBasePath;if(i.initInstance){i.initInstance(f)}f.contentDocument=f.getDoc();f.contentWindow=f.getWin();f.undoRedo=f.undoManager;f.startContent=f.getContent({format:"raw"});tinyMCE.instances[f.id]=f;tinyMCE.loadedFiles=[]});f.onActivate.add(function(){tinyMCE.settings=f.settings;tinyMCE.selectedInstance=f});if(i.handleNodeChange){f.onNodeChange.add(function(l,k,m){i.handleNodeChange(l.id,m,0,0,false,!l.selection.isCollapsed())})}if(i.onChange){f.onChange.add(function(k,l){returni.onChange(k)})}if(i.cleanup){f.onGetContent.add(function(){})}this.getInfo=function(){returni.getInfo()};this.createControl=function(k){tinyMCE.pluginURL=tinymce.baseURL+"/plugins/"+g;tinyMCE.themeURL=tinymce.baseURL+"/themes/"+tinyMCE.activeEditor.settings.theme;if(i.getControlHTML){returni.getControlHTML(k)}returnnull};this.execCommand=function(l,k,m){if(i.execCommand){returni.execCommand(f.id,f.getBody(),l,k,m)}returnfalse}}tinymce.PluginManager.add(g,j)},_getDOM:function(){returntinyMCE.activeEditor?tinyMCE.activeEditor.dom:tinymce.DOM},convertRelativeToAbsoluteURL:function(f,g){returnnewtinymce.util.URI(f).toAbsolute(g)},convertAbsoluteURLToRelativeURL:function(f,g){returnnewtinymce.util.URI(f).toRelative(g)}});tinymce.extend(tinymce.Editor.prototype,{getFocusElement:function(){returnthis.selection.getNode()},getData:function(f){if(!this.data){this.data=[]}if(!this.data[f]){this.data[f]=[]}returnthis.data[f]},hasPlugin:function(f){returnthis.plugins[f]!=null},getContainerWin:function(){returnwindow},getHTML:function(f){returnthis.getContent({format:f?"raw":"html"})},setHTML:function(f){this.setContent(f)},getSel:function(){returnthis.selection.getSel()},getRng:function(){returnthis.selection.getRng()},isHidden:function(){varf;if(!tinymce.isGecko){returnfalse}f=this.getSel();return(!f||!f.rangeCount||f.rangeCount==0)},translate:function(f){varh=this.settings.language,g;if(!f){returnf}g=tinymce.EditorManager.i18n[h+"."+f]||f.replace(/{\#([^}]+)\}/g,function(j,i){returntinymce.EditorManager.i18n[h+"."+i]||"{#"+i+"}"});g=g.replace(/{\$lang_([^}]+)\}/g,function(j,i){returntinymce.EditorManager.i18n[h+"."+i]||"{$lang_"+i+"}"});returng},repaint:function(){this.execCommand("mceRepaint")}});tinymce.extend(tinymce.dom.Selection.prototype,{getSelectedText:function(){returnthis.getContent({format:"text"})},getSelectedHTML:function(){returnthis.getContent({format:"html"})},getFocusElement:function(){returnthis.getNode()},selectNode:function(i,j,g,f){varh=this;h.select(i,g||0);if(!b(j)){j=true}if(j){if(!b(f)){f=true}h.collapse(f)}}})}).call(this);tinymce.PluginManager.add("compat2x",tinymce.plugins.Compat2x)})();