//appeler l'Editeur tinyMCE
tinyMCE.init({
	mode : "textareas",
	//elements : "ajaxfilemanager",
	language : "fr",
	editor_selector : "mceEditor",
	theme : "advanced",
	skin : "so",
	content_css : "styles/cms_tinyMCE.css",
	
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	//theme_advanced_statusbar_location : "top",

	plugins : "advimage,contextmenu,emotions,paste,advlink,table",
	theme_advanced_buttons1 : "code,pastetext,|,removeformat,|,styleselect,|,forecolor,|,bold,italic",
	theme_advanced_buttons2 : "underline,strikethrough,|,justifyleft,justifycenter,justifyright,|,sub,sup,|,emotions,|,link,unlink,|,image",
	theme_advanced_buttons3 : "",

	paste_use_dialog : false,
	theme_advanced_resizing : false,
	apply_source_formatting : true,
	inline_styles : true,
	fix_list_elements : true,
	cleanup : true,	
	force_br_newlines : false,
	force_p_newlines : true,	
	//sorin: Paths - heavy times!!!!
	relative_urls : true, //sorin: c'était false, j'ai mis true
	//remove_script_host : false,
	document_base_url : "/home/www/101eb2da035db2c1485c24a0ac468ea4/users/ljchambrier/web/", //ligne rajoutée
	width : "100%",
	height : "200",
	
	file_browser_callback : "ajaxfilemanager"
});

//Ajax File Manager
function ajaxfilemanager(field_name, url, type, win) {
	var ajaxfilemanagerurl = "../../../../admin/ajaxfilemanager/ajaxfilemanager.php";
	switch (type) {
		case "image":
			break;
		case "media":
			break;
		case "flash": 
			break;
		case "file":
			break;
		default:
			return false;
	}
	tinyMCE.activeEditor.windowManager.open({
			url: "../../../../admin/ajaxfilemanager/ajaxfilemanager.php",
			width: 843,
			height: 660,
			inline : "yes",
			close_previous : "no"
	},{
			window : win,
			input : field_name
	});
}

function AddEditor() {
	tinyMCE.execCommand('mceAddControl', false, 'zone_text');
}
function RemoveEditor() {
	tinyMCE.execCommand('mceRemoveControl', false, 'zone_text');
}
