/*tinyMCE.init({
	elements : "ajaxfilemanager",
	theme : "advanced",
	mode : "textareas",
	plugins : "advimage,advlink,media,contextmenu",
	elements : "notaPost,notaPost2,notaPost3,notaPost4,notaPost5,notaPost6,notaPost7",
	theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,code",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "center"
});*/

tinyMCE.init({
			mode : "textareas",
			elements : "ajaxfilemanager",
			theme : "advanced",
			plugins : "advimage,advlink,media,contextmenu",
			
			elements : "notaPost,notaPost2,notaPost3,notaPost4,notaPost5,notaPost6,notaPost7",
			theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink",//,image,code",
			theme_advanced_buttons2 : "",
			theme_advanced_buttons3 : "",
			
			/*theme_advanced_buttons1_add_before : "newdocument,separator",
			theme_advanced_buttons1_add : "fontselect,fontsizeselect",
			theme_advanced_buttons2_add : "separator,forecolor,backcolor,liststyle",
			theme_advanced_buttons2_add_before: "cut,copy,separator,",
			theme_advanced_buttons3_add_before : "",
			theme_advanced_buttons3_add : "media",*/
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			//extended_valid_elements : "hr[class|width|size|noshade]",
			file_browser_callback : "ajaxfilemanager",
			paste_use_dialog : false,
			theme_advanced_resizing : true,
			theme_advanced_resize_horizontal : true,
			apply_source_formatting : true,
			force_br_newlines : true,
			force_p_newlines : false,	
			relative_urls : true
		});

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