var switchEditors={mode:"",I:function(a){return document.getElementById(a)},edInit:function(){var a=tinymce.util.Cookie.getHash("TinyMCE_content_size");if(getUserSetting("editor")=="html"){if(a){try{this.I("content").style.height=a.ch-30+"px"}catch(b){}}}else{try{this.I("quicktags").style.display="none"}catch(b){}tinyMCE.execCommand("mceAddControl",false,"content")}},saveCallback:function(b,c,a){if(tinyMCE.activeEditor.isHidden()){c=this.I(b).value}else{c=this.pre_wpautop(c)}return c},pre_wpautop:function(b){var c,a;b=b.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(d){d=d.replace(/
[\r\n]*/g,"");return d.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"")});c="blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|p";b=b.replace(new RegExp("\\s*\\s*","mg"),"\n");b=b.replace(new RegExp("\\s*<(("+c+")[^>]*)>","mg"),"\n<$1>");b=b.replace(new RegExp("(

]+>.*?)

","mg"),"$1");b=b.replace(new RegExp("]*)>\\s*

","mgi"),"\n\n");b=b.replace(new RegExp("\\s*

","mgi"),"");b=b.replace(new RegExp("\\s*

\\s*","mgi"),"\n\n");b=b.replace(new RegExp("\\n\\s*\\n","mgi"),"\n\n");b=b.replace(new RegExp("\\s*
\\s*","gi"),"\n");b=b.replace(new RegExp("\\s*\\s*","mg"),"\n");b=b.replace(new RegExp("\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*","gi"),"\n\n[caption$1[/caption]\n\n");b=b.replace(new RegExp("caption\\]\\n\\n+\\[caption","g"),"caption]\n\n[caption");a="blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre";b=b.replace(new RegExp("\\s*<(("+a+") ?[^>]*)\\s*>","mg"),"\n<$1>");b=b.replace(new RegExp("\\s*\\s*","mg"),"\n");b=b.replace(new RegExp("]*)>","g"),"\t");if(b.indexOf("/g,function(d){return d.replace(/[\r\n]+/g,"")})}b=b.replace(new RegExp("","g"),"

\n");b=b.replace(new RegExp("\\s*(

]+>.*

)","mg"),"\n$1");b=b.replace(new RegExp("^\\s*",""),"");b=b.replace(new RegExp("[\\s\\u00a0]*$",""),"");b=b.replace(//g,"\n");return b},go:function(g,e){g=g||"content";e=e||this.mode||"";var b=tinyMCE.get(g)||false,f=this.I("quicktags"),c=this.I("edButtonHTML"),d=this.I("edButtonPreview"),a=this.I(g);if("tinymce"==e){if(b&&!b.isHidden()){return false}this.mode="html";a.style.color="#fff";d.className="active";c.className="";edCloseAllTags();f.style.display="none";a.value=this.wpautop(a.value);if(b){b.show()}else{tinyMCE.execCommand("mceAddControl",false,g)}setUserSetting("editor","tinymce")}else{if(!b||b.isHidden()){return false}this.mode="tinymce";c.className="active";d.className="";a.style.height=b.getContentAreaContainer().offsetHeight+6+"px";b.hide();f.style.display="block";a.style.color="";setUserSetting("editor","html")}return false},wpautop:function(a){var b="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]";if(a.indexOf("/g,function(c){return c.replace(/[\r\n]+/g,"")})}a=a.replace(/<[^<>]+>/g,function(c){return c.replace(/[\r\n]+/g," ")});a=a+"\n\n";a=a.replace(new RegExp("
\\s*
","gi"),"\n\n");a=a.replace(new RegExp("(<(?:"+b+")[^>]*>)","gi"),"\n$1");a=a.replace(new RegExp("()","gi"),"$1\n\n");a=a.replace(new RegExp("\\r\\n|\\r","g"),"\n");a=a.replace(new RegExp("\\n\\s*\\n+","g"),"\n\n");a=a.replace(new RegExp("([\\s\\S]+?)\\n\\n","mg"),"

$1

\n");a=a.replace(new RegExp("

\\s*?

","gi"),"");a=a.replace(new RegExp("

\\s*(]*>)\\s*

","gi"),"$1");a=a.replace(new RegExp("

(","gi"),"$1");a=a.replace(new RegExp("

\\s*]*)>","gi"),"

");a=a.replace(new RegExp("\\s*

","gi"),"

");a=a.replace(new RegExp("

\\s*(]*>)","gi"),"$1");a=a.replace(new RegExp("(]*>)\\s*

","gi"),"$1");a=a.replace(new RegExp("\\s*\\n","gi"),"
\n");a=a.replace(new RegExp("(]*>)\\s*
","gi"),"$1");a=a.replace(new RegExp("
(\\s*)","gi"),"$1");a=a.replace(new RegExp("(?:

|
)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:

|
)*","gi"),"[caption$1[/caption]");a=a.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(c){c=c.replace(/
[\r\n]*/g,"\n");return c.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"\n")});return a}};