(function(){var b=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(k,j){var i=this,h={},l,a;i.editor=k;k.addCommand("mceFullScreen",function(){var d,c=b.doc.documentElement;if(k.getParam("fullscreen_is_enabled")){if(k.getParam("fullscreen_new_window")){closeFullscreen()}else{b.win.setTimeout(function(){tinymce.dom.Event.remove(b.win,"resize",i.resizeFunc);tinyMCE.get(k.getParam("fullscreen_editor_id")).setContent(k.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(k);b.remove("mce_fullscreen_container");c.style.overflow=k.getParam("fullscreen_html_overflow");b.setStyle(b.doc.body,"overflow",k.getParam("fullscreen_overflow"));b.win.scrollTo(k.getParam("fullscreen_scrollx"),k.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(k.getParam("fullscreen_new_window")){d=b.win.open(j+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{d.resizeTo(screen.availWidth,screen.availHeight)}catch(e){}}else{tinyMCE.oldSettings=tinyMCE.settings;h.fullscreen_overflow=b.getStyle(b.doc.body,"overflow",1)||"auto";h.fullscreen_html_overflow=b.getStyle(c,"overflow",1);l=b.getViewPort();h.fullscreen_scrollx=l.x;h.fullscreen_scrolly=l.y;if(tinymce.isOpera&&h.fullscreen_overflow=="visible"){h.fullscreen_overflow="auto"}if(tinymce.isIE&&h.fullscreen_overflow=="scroll"){h.fullscreen_overflow="auto"}if(tinymce.isIE&&(h.fullscreen_html_overflow=="visible"||h.fullscreen_html_overflow=="scroll")){h.fullscreen_html_overflow="auto"}if(h.fullscreen_overflow=="0px"){h.fullscreen_overflow=""}b.setStyle(b.doc.body,"overflow","hidden");c.style.overflow="hidden";l=b.getViewPort();b.win.scrollTo(0,0);if(tinymce.isIE){l.h-=1}if(tinymce.isIE6){a="absolute;top:"+l.y}else{a="fixed;top:0"}n=b.add(b.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+a+";left:0;width:"+l.w+"px;height:"+l.h+"px;z-index:200000;"});b.add(n,"div",{id:"mce_fullscreen"});tinymce.each(k.settings,function(g,f){h[f]=g});h.id="mce_fullscreen";h.width=n.clientWidth;h.height=n.clientHeight-15;h.fullscreen_is_enabled=true;h.fullscreen_editor_id=k.id;h.theme_advanced_resizing=false;h.save_onsavecallback=function(){k.setContent(tinyMCE.get(h.id).getContent({format:"raw"}),{format:"raw"});k.execCommand("mceSave")};tinymce.each(k.getParam("fullscreen_settings"),function(f,g){h[g]=f});if(h.theme_advanced_toolbar_location==="external"){h.theme_advanced_toolbar_location="top"}i.fullscreenEditor=new tinymce.Editor("mce_fullscreen",h);i.fullscreenEditor.onInit.add(function(){i.fullscreenEditor.setContent(k.getContent());i.fullscreenEditor.focus()});i.fullscreenEditor.render();i.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");i.fullscreenElement.update();i.resizeFunc=tinymce.dom.Event.add(b.win,"resize",function(){var q=tinymce.DOM.getViewPort(),g=i.fullscreenEditor,p,f;p=g.dom.getSize(g.getContainer().firstChild);f=g.dom.getSize(g.getContainer().getElementsByTagName("iframe")[0]);g.theme.resizeTo(q.w-p.w+f.w,q.h-p.h+f.h)})}});k.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});k.onNodeChange.add(function(c,d){d.setActive("fullscreen",c.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();