(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(f,b){var d='<img src="'+b+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',e="mcePageBreak",a=f.getParam("pagebreak_separator","<!-- pagebreak -->"),c;c=new RegExp(a.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");f.addCommand("mcePageBreak",function(){f.execCommand("mceInsertContent",0,d)});f.addButton("pagebreak",{title:"pagebreak.desc",cmd:e});f.onInit.add(function(){if(f.settings.content_css!==false){f.dom.loadCSS(b+"/css/content.css")}if(f.theme.onResolveName){f.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&f.dom.hasClass(h.node,e)){h.name="pagebreak"}})}});f.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,e)){g.selection.select(h)}});f.onNodeChange.add(function(g,i,h){i.setActive("pagebreak",h.nodeName==="IMG"&&g.dom.hasClass(h,e))});f.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(c,d)});f.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=a}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})();