/////////////////////////////////
// paramètrage du WYSIWYG
/////////////////////////////////
tinyMCE.init({
	language : "fr",
	mode : "textareas",
	elements : "ajaxfilemanager",
	theme : "advanced",
	plugins : "table,preview,contextmenu,paste",

theme_advanced_buttons1_add : "preview,newdocument,code,separator,removeformat,image,pastetext,separator,bold,italic,underline,separator,outdent,indent,separator,undo,redo,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,anchor,unlink,link,separator,forecolor",
theme_advanced_buttons2_add : "styleselect,formatselect,fontsizeselect",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "bottom",
	plugin_insertdate_dateFormat : "%Y-%m-%d",
	plugin_insertdate_timeFormat : "%H:%M:%S",
	extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",

	// recuperation chemin absolut a l'insertion d'une image
	relative_urls : false,
	remove_script_host : false,

	theme_advanced_resizing : true,
	theme_advanced_resize_horizontal : false,
	apply_source_formatting : true,
	width : "750",
	height: "150",
	//content_css : "css/tinycss.css",
	file_browser_callback : "ajaxfilemanager",

	theme_advanced_disable : "styleselect,formatselect,outdent,indent,removeformat,hr,visualaid,sub,sup,separator,charmap,rule,image,anchor,cleanup,help,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,undo,redo,unlink,link,bullist,numlist,code"
});


		function ajaxfilemanager(field_name, url, type, win) {
			var ajaxfilemanagerurl = "../../plugins/ajaxfilemanager/ajaxfilemanager.php";
			switch (type) {
				case "image":
					break;
				case "media":
					break;
				case "flash": 
					break;
				case "file":
					break;
				default:
					return false;
			}
			var fileBrowserWindow = new Array();
			fileBrowserWindow["file"] = ajaxfilemanagerurl;
			fileBrowserWindow["title"] = "Ajax File Manager";
			fileBrowserWindow["width"] = "782";
			fileBrowserWindow["height"] = "440";
			fileBrowserWindow["close_previous"] = "no";
			tinyMCE.openWindow(fileBrowserWindow, {
			  window : win,
			  input : field_name,
			  resizable : "yes",
			  inline : "yes",
			  editor_id : tinyMCE.getWindowArg("editor_id")
			});
			
			return false;
		}
