
tinyMCE.init({
	mode : "textareas",
	theme : "advanced",
	editor_selector : "nwrptext",
	language : "en",
	remove_linebreaks : "false",
	plugins : "flash,advlink,table,paste,advimage",
	theme_advanced_buttons1_add : "removeformat,cleanup,separator,code,separator,help", //,separator", //,visualaid
	theme_advanced_buttons2_add : "advimage,flash,separator,table,separator,hr,charmap",
	remove_linebreaks : "false",
	theme_advanced_buttons1_add_before: "undo,redo,separator",
	theme_advanced_buttons2_add_before: "cut,copy,paste,separator,pastetext,pasteword,selectall,separator",
	theme_advanced_disable : ",strikethrough,sub,sup,help,code,cleanup,undo,redo", 
	//theme_advanced_disable : "formatselect"
	theme_advanced_buttons3 : "",
	theme_advanced_styles: "imgcaption=imgcaption; normaal=normaal;extern=extern;acht=acht;negen=negen;tien=tien;elf=elf;twaalf=twaalf;veertien=veertien;zestien=zestien",
	font_size_style_values : "xx-small,x-small,small,medium,large,x-large,xx-large",
	convert_fonts_to_spans: true,
	content_css : "/stylesheets/mamacash_mce.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",
	//relative_urls : true,
	//remove_script_host : false
	//document_base_url : ".."
	convert_urls : false
});

function fileBrowserCallBack(field_name, url, type, win) {
    var connector = "../../filemanager/browser.html?Connector=/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");
}
