(function(){var b=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(j,i){var h=this,g={},a;h.editor=j;j.addCommand("mceFullScreen",function(){var d,c=b.doc.documentElement;if(j.getParam("fullscreen_is_enabled")){if(j.getParam("fullscreen_new_window")){closeFullscreen()}else{b.win.setTimeout(function(){tinymce.dom.Event.remove(b.win,"resize",h.resizeFunc);tinyMCE.get(j.getParam("fullscreen_editor_id")).setContent(j.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(j);b.remove("mce_fullscreen_container");c.style.overflow=j.getParam("fullscreen_html_overflow");b.setStyle(b.doc.body,"overflow",j.getParam("fullscreen_overflow"));b.win.scrollTo(j.getParam("fullscreen_scrollx"),j.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(j.getParam("fullscreen_new_window")){d=b.win.open(i+"/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;g.fullscreen_overflow=b.getStyle(b.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=b.getStyle(c,"overflow",1);a=b.getViewPort();g.fullscreen_scrollx=a.x;g.fullscreen_scrolly=a.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}b.setStyle(b.doc.body,"overflow","hidden");c.style.overflow="hidden";a=b.getViewPort();b.win.scrollTo(0,0);if(tinymce.isIE){a.h-=1}n=b.add(b.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+(tinymce.isIE6||(tinymce.isIE&&!b.boxModel)?"absolute":"fixed")+";top:0;left:0;width:"+a.w+"px;height:"+a.h+"px;z-index:200000;"});b.add(n,"div",{id:"mce_fullscreen"});tinymce.each(j.settings,function(l,f){g[f]=l});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=j.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){j.setContent(tinyMCE.get(g.id).getContent({format:"raw"}),{format:"raw"});j.execCommand("mceSave")};tinymce.each(j.getParam("fullscreen_settings"),function(f,k){g[k]=f});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}h.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);h.fullscreenEditor.onInit.add(function(){h.fullscreenEditor.setContent(j.getContent());h.fullscreenEditor.focus()});h.fullscreenEditor.render();h.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");h.fullscreenElement.update();h.resizeFunc=tinymce.dom.Event.add(b.win,"resize",function(){var f=tinymce.DOM.getViewPort(),p=h.fullscreenEditor,q,o;q=p.dom.getSize(p.getContainer().firstChild);o=p.dom.getSize(p.getContainer().getElementsByTagName("iframe")[0]);p.theme.resizeTo(f.w-q.w+o.w,f.h-q.h+o.h)})}});j.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});j.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)})();