/* 
global config for backend
*/
tinyMCE.init({
	// General options
	mode : "textareas", 
	theme : "advanced",
	plugins : "safari,inlinepopups,paste",
	editor_deselector : "no-default-editor",
	
	// Theme options
	theme_advanced_buttons1 : "pastetext,pasteword,bold,italic,bullist,numlist,link,unlink,removeformat,image,code,undo,redo",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	relative_urls : false,
	handle_event_callback : "editorOnChange"
});



//stuff to allow checking of whether editor(s) contents have changed
var editor_contents_changed = {}
function editorOnChange(){
	if (tinyMCE.activeEditor.isDirty())
		editor_contents_changed[tinyMCE.activeEditor.id] = true; //set a dict item for *this* editor to be true
	else
		editor_contents_changed[tinyMCE.activeEditor.id] = false; //set the dict item for *this* editor to be false
	
	try{
		editor_onchange_callback(); //call it if it exists
	}
	catch(e){}
}

