(function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(b,c){var a=this;a.editor=b;b.addCommand("mceFullPageProperties",function(){b.windowManager.open({file:c+"/fullpage.htm",width:430+parseInt(b.getLang("fullpage.delta_width",0)),height:495+parseInt(b.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:c,head_html:a.head})});b.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});b.onBeforeSetContent.add(a._setContent,a);b.onSetContent.add(a._setBodyAttribs,a);b.onGetContent.add(a._getContent,a)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(b,j){var h,a,c,e,l,f,g,d=this.head.match(/body(.*?)>/i);if(d&&d[1]){h=d[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(h){for(a=0,c=h.length;a<c;a++){e=h[a].split("=");l=e[0].replace(/\s/,"");f=e[1];if(f){f=f.replace(/^\s+/,"").replace(/\s+$/,"");g=f.match(/^["'](.*)["']$/);if(g){f=g[1]}}else{f=l}b.dom.setAttrib(b.getBody(),"style",f)}}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true})},_setContent:function(d,b){var h=this,a,j,f=b.content,g,i="";if(b.format=="raw"&&h.head){return}if(b.source_view&&d.getParam("fullpage_hide_in_source_view")){return}f=f.replace(/<(\/?)BODY/gi,"<$1body");a=f.indexOf("<body");if(a!=-1){a=f.indexOf(">",a);h.head=f.substring(0,a+1);j=f.indexOf("</body",a);if(j==-1){j=f.indexOf("</body",j)}b.content=f.substring(a+1,j);h.foot=f.substring(j);function e(c){return c.replace(/<\/?[A-Z]+/g,function(k){return k.toLowerCase()})}h.head=e(h.head);h.foot=e(h.foot)}else{h.head="";if(d.getParam("fullpage_default_xml_pi")){h.head+='<?xml version="1.0" encoding="'+d.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'}h.head+=d.getParam("fullpage_default_doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');h.head+="\n<html>\n<head>\n<title>"+d.getParam("fullpage_default_title","Untitled document")+"</title>\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='<meta http-equiv="Content-Type" content="'+g+'" />\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="</head>\n<body"+(i?' style="'+i+'"':"")+">\n";h.foot="\n</body>\n</html>"}},_getContent:function(b,a){var c=this;if(!a.source_view||!b.getParam("fullpage_hide_in_source_view")){a.content=tinymce.trim(c.head)+"\n"+tinymce.trim(a.content)+"\n"+tinymce.trim(c.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})();