//appeler l'Editeur tinyMCE
tinyMCE.init({
	mode : "specific_textareas",
	language : "fr",
	editor_selector : "mceEditor",
	theme : "advanced",
	skin : "so",
	content_css : "php/cms_tinyMCE.css",
	
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "top",
	theme_advanced_resizing : true,

	plugins : "advimage,advlink,media,contextmenu,fullscreen,style,searchreplace,advhr,paste,preview,emotions,table",
	theme_advanced_buttons1 : "code,|,fullscreen,|,preview,|,undo,redo,|,removeformat,cleanup,|,pastetext,pasteword,selectall",
	theme_advanced_buttons2 : "table,|,styleprops,|,bullist,numlist,|,indent,outdent,|,advhr,|,charmap,|,anchor,link,unlink,|,emotions,|,media,image",
	theme_advanced_buttons3 : "styleselect,_fontsizeselect,_forecolor,_backcolor,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,|,sub,sup",


	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,	
	relative_urls : true,
	width : "100%",
	height : "350",
	//auto_resize : true,
	
	file_browser_callback : "ajaxfilemanager"
});


//Ajax File Manager
function ajaxfilemanager(field_name, url, type, win) {
	var ajaxfilemanagerurl = "../../../../js/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: "../../../../js/ajaxfilemanager/ajaxfilemanager.php",
			width: 843,
			height: 660,
			inline : "yes",
			close_previous : "no"
	},{
			window : win,
			input : field_name
	});
}
