var tinymce_advanced_options = {
		mode : "textareas",
	    theme : "advanced",
	    height:"300px",
	    width:"600px",
	  
	    
	    //BEGIN ONE OF THEM
	    plugins : "searchreplace,advlink,advimage,insertdatetime,advhr,emotions,media,safari,print,contextmenu",
		theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "search,replace,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,image,cleanup,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "hr,removeformat,|,sub,sup,|,charmap,emotions,media,|,print",
		
		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,
		language : 'de',
		forced_root_block : '',
			
		//Performance Tuning
		//entity_encoding : "raw" //DO NOT ACTIVATE, IT CAUSES GET-PARAMETER BUG
		button_tile_map : true,
		verify_html : false
		//END ONE OF THEM
};

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


tinyMCE.init(tinymce_advanced_options);