tinyMCE.init({
	mode : "textareas",
	theme : "advanced",
	editor_selector : "nwrptext",
	language : "en",
	remove_linebreaks : "false",
	plugins : "flash,advlink,table,paste",
	theme_advanced_buttons1_add : "removeformat,cleanup,code,help",
	theme_advanced_buttons2_add : "flash,table,hr,charmap",
	remove_linebreaks : "false",
	theme_advanced_buttons1_add_before: "undo,redo",
	theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,selectall",
	theme_advanced_styles: "bold=bold;tien=tien;elf=elf;twaalf=twaalf;veertien=veertien;zestien=zestien",
	theme_advanced_disable : "strikethrough,sub,sup,help,code,cleanup,undo,redo,styles", 
	theme_advanced_buttons3 : "",
	content_css : "stylesheets/tcb.css",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	save_enablewhendirty: true,
	//auto_cleanup_word : true,
	plugin_insertdate_dateFormat : "%d-%m-%Y",
	plugin_insertdate_timeFormat : "%H:%M:%S",
	file_browser_callback : "fileBrowserCallBack",
	extended_valid_elements : "li[class|id],hr[class|size|noshade|color],br[class|id|clear<all?left?none?right],area[shape|href|onmouseover|onmouseout|coords],map[name],img[id|class|src|border|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap]",
	invalid_elements : "font",
	remove_script_host : true
});

function fileBrowserCallBack(field_name, url, type, win) {
    var connector = "../../filemanager/browser.html?Connector=/decornuiten/connector/connector.php";
    var enableAutoTypeSelection = true;

    var cType;
    tinyfck_field = field_name;
    tinyfck = win;

    switch (type) {
        case "image":
            cType = "Image";
            break;
        case "flash":
            cType = "Flash";
            break;
        case "file":
            cType = "File";
            break;
    }

    if (enableAutoTypeSelection && cType) {
        connector += "&Type=" + cType;
    }

    window.open(connector, "tinyfck", "modal,width=600,height=400");
}

