(function(f){var j,g=[];function h(c,d,a){var b;b=f.fn[d];f.fn[d]=function(){var e;if(c!=="after"){e=a.apply(this,arguments);if(e!==undefined){return e}}e=b.apply(this,arguments);if(c!=="before"){a.apply(this,arguments)}return e}}f.fn.tinymce=function(c){var d=this,e,b="",l;if(!d.length){return}if(!c){return tinyMCE.get(this[0].id)}function a(){if(i){i();i=null}d.each(function(k,q){var n,r=q.id||tinymce.DOM.uniqueId();q.id=r;n=new tinymce.Editor(r,c);n.render()})}if(!window.tinymce&&!j&&(e=c.script_url)){j=1;if(/_(src|dev)\.js/g.test(e)){b="_src"}window.tinyMCEPreInit={base:e.substring(0,e.lastIndexOf("/")),suffix:b,query:""};f.getScript(e,function(){tinymce.dom.Event.domLoaded=1;j=2;a();f.each(g,function(n,k){k()})})}else{if(j===1){g.push(a)}else{a()}}};f.extend(f.expr[":"],{tinymce:function(a){return a.id&&!!tinyMCE.get(a.id)}});function i(){function b(){this.find("span.mceEditor,div.mceEditor").each(function(d,c){var e;if(e=tinyMCE.get(c.id.replace(/_parent$/,""))){e.remove()}})}function a(c){var d;if(c!==undefined){b.call(this);this.each(function(m,e){var n;if(n=tinyMCE.get(e.id)){n.setContent(c)}})}else{if(this.length>0){if(d=tinyMCE.get(this[0].id)){return d.getContent()}}}}h("both","text",function(c){if(c!==undefined){return a.call(this,c)}if(this.length>0){if(ed=tinyMCE.get(this[0].id)){return ed.getContent().replace(/<[^>]+>/g,"")}}});f.each(["val","html"],function(c,d){h("both",d,a)});f.each(["append","prepend"],function(c,d){h("before",d,function(e){if(e!==undefined){this.each(function(o,n){var p;if(p=tinyMCE.get(n.id)){if(d==="append"){p.setContent(p.getContent()+e)}else{p.setContent(e+p.getContent())}}})}})});h("both","attr",function(d,c){if(d&&d==="value"){return a.call(this,c)}});f.each(["remove","replaceWith","replaceAll","empty"],function(c,d){h("before",d,b)})}})(jQuery);