tinyMCE.init({
	mode : "none",
	elements : "text",
	theme : "advanced",
	content_css : "http://" + document.domain + "/styles/global.css",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_buttons1 : "bold,italic,separator,bullist,numlist,separator,outdent,indent,separator,link,unlink,image,media,,separator,undo,separator,code,separator,pasteword,selectall,cleanup",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	valid_elements : "+a[href|rel|title|name],abbr[title],-b/strong,-i/em,-u,#p,-ol[type],-ul[type],-pre/listing/plaintext/xmp,-li,br[clear<all?left?none?right],img[id|style|class|src|border|alt=|title|hspace|vspace|width|height|align],-blockquote,-center,-cite,-code,-table[border=0|cellspacing|cellpadding|width|height|class|align|style|id|bgcolor|background],-tbody[align],-tr[id|class|rowspan|width|height|align|valign|style|bgcolor|background],-td[id|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background],-th[id|class|colspan|rowspan|width|height|align|valign|style],-div[id|class|align],-h2,-h3,-h4,-h5,-h6,hr[class|style],dd,dl,dt,-s/strike,object[width|height],param[name|value],embed[src|type|allowFullScreen|width|height|embed|style|id|allowscriptaccess|quality|bgcolor|wmode|flashvars]",
	convert_newlines_to_brs : true,
	relative_urls : false,
	remove_script_host : true,
	document_base_url : "http://blogcritics.org/",
	plugins : "media,autosave,paste,spellchecker",
	paste_create_paragraphs : false,
	paste_create_linebreaks : false,
	paste_use_dialog : true,
	paste_auto_cleanup_on_paste : true,
	paste_convert_middot_lists : false,
	paste_unindented_list_class : "unindentedList",
	paste_convert_headers_to_strong : true,
	paste_insert_word_content_callback : "convertWord"
});
var tinyMCEmode = false;
function toggleEditorMode(sEditorID) {
  if(tinyMCEmode) {
    tinyMCE.removeMCEControl(tinyMCE.getEditorId(sEditorID));
    document.getElementById(sEditorID).value=document.getElementById(sEditorID).value.replace(/<br \/>/g,"\n");
    tinyMCEmode = false;
  } else {
    tinyMCE.addMCEControl(document.getElementById(sEditorID), sEditorID);
    tinyMCEmode = true;
    // Adding this so the css that is applied to articles is also applied to the rte 
    $('.mceEditor iframe').get(0).contentDocument.body.id = "article-body";
  }
}
