// Rich Text Area -- textarea must be named richtextarea
tinyMCE.init({
	mode : "textareas",
	editor_selector : "richtextarea",
	width: "685",
	theme : "advanced",
	content_css : "/css/settings.css",
	plugins : "advimage,advlink,advimage,table,style,searchreplace,print,preview,insertdatetime,spellchecker,inlinepopups",
	theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,visualaid,code,cleanup,removeformat,separator,search,replace,separator,cut,copy,paste,separator,undo,redo,separator,print,preview, separator,link,unlink,anchor,separator,bullist,numlist",
	theme_advanced_buttons2 : "styleprops,separator,image,separator,charmap,hr,ibrowser,separator,formatselect,separator,styleselect,separator,,spellchecker,separator,tablecontrols",
	theme_advanced_buttons3 : "",
	theme_advanced_buttons4 : "",
	theme_advanced_styles : "Highlight=highlight;Warning=warning",
	spellchecker_languages : "+English=en",
	file_browser_callback : "ajaxfilemanager",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "",
	plugin_insertdate_dateFormat : "%Y-%m-%d",
	plugin_insertdate_timeFormat : "%H:%M:%S",
	plugin_preview_width : "500",
	plugin_preview_height : "600"
});
// Simple Text Area -- textarea must be named simpletextarea
tinyMCE.init({
	mode : "textareas",
	editor_selector : "simpletextarea",
	width: "685",
	theme : "advanced",
	content_css : "/css/settings.css",
	theme_advanced_buttons1 : "bold,italic,underline,separator,bullist,separator,cut,copy,paste,undo,separator,link,unlink,code,cleanup",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	file_browser_callback : "ajaxfilemanager",
	theme_advanced_styles : "Highlight=highlight;Warning=warning",
	spellchecker_languages : "+English=en",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : ""
});
// Preview Text Area -- textarea must be named previewtextarea
tinyMCE.init({
	mode : "textareas",
	editor_selector : "previewtextarea",
	width: "600",
	height: "400",
	theme : "advanced",
	content_css : "/css/settings.css",
	file_browser_callback : "ajaxfilemanager",
	theme_advanced_buttons1 : "",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_styles : "Highlight=highlight;Warning=warning",
	spellchecker_languages : "+English=en",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "",
	extended_valid_elements : "",
	valid_elements : "",
	convert_urls : false
});
// Slim Rich Text Area -- textarea must be named slimrichtextarea
tinyMCE.init({
	mode : "textareas",
	editor_selector : "slimrichtextarea",
	width: "595",
	theme : "advanced",
	content_css : "/css/settings.css",
	plugins : "advimage,advlink,table,advimage,style,searchreplace,print,preview,insertdatetime,spellchecker,inlinepopups",
	theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,visualaid,code,cleanup,removeformat,separator,search,replace,separator,cut,copy,paste,separator,undo,redo,separator,print,preview, separator",
	theme_advanced_buttons2 : "link,unlink,anchor,separator,bullist,numlist,separator,styleprops,separator,image,separator,charmap,hr,ibrowser,separator,formatselect,separator,styleselect,separator,,spellchecker",
	theme_advanced_buttons3 : "tablecontrols",
	theme_advanced_buttons4 : "",
	theme_advanced_styles : "Highlight=highlight;Warning=warning",
	spellchecker_languages : "+English=en",
	file_browser_callback : "ajaxfilemanager",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "",
	plugin_insertdate_dateFormat : "%Y-%m-%d",
	plugin_insertdate_timeFormat : "%H:%M:%S",
	plugin_preview_width : "500",
	plugin_preview_height : "600"
});
// Slim Simple Text Area -- textarea must be named slimsimpletextarea
tinyMCE.init({
	mode : "textareas",
	editor_selector : "slimsimpletextarea",
	width: "595",
	theme : "advanced",
	content_css : "/css/settings.css",
	content_css2 : "/css/textformat.css",
	file_browser_callback : "ajaxfilemanager",
	theme_advanced_buttons1 : "bold,italic,underline,separator,bullist,separator,cut,copy,paste,undo,separator,link,unlink,code,cleanup",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_styles : "Highlight=highlight;Warning=warning",
	spellchecker_languages : "+English=en",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "",
	extended_valid_elements : ""
});
// Preview Text Area -- textarea must be named previewtextarea
tinyMCE.init({
	mode : "textareas",
	editor_selector : "previewtextarea",
	width: "600",
	height: "400",
	theme : "advanced",
	content_css : "/css/settings.css",
	content_css2 : "/css/textformat.css",
	file_browser_callback : "ajaxfilemanager",
	theme_advanced_buttons1 : "",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_styles : "Highlight=highlight;Warning=warning",
	spellchecker_languages : "+English=en",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "",
	extended_valid_elements : "",
	valid_elements : "",
	convert_urls : false
});
function ajaxfilemanager(field_name, url, type, win) {
			var ajaxfilemanagerurl = "../../../../scripts/texteditor/plugins/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: "../../../../scripts/texteditor/plugins/ajaxfilemanager/ajaxfilemanager.php",
                width: 782,
                height: 440,
                inline : "yes",
                close_previous : "no"
            },{
                window : win,
                input : field_name
            });            
		}
