
tinyMCE.init({
    language : "fr",
    mode : "exact",
    elements : "actu_text, page_text",
    theme : "advanced",
    plugins : "spellchecker,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable",

    theme_advanced_buttons1_add_before : "save,newdocument,separator",

    theme_advanced_disable : "bullist,sub,sup,code,help,cleanup,anchor removeformat,hr,strikethrough,indent,outdent,separator,visualaid, charmap,numlist,formatselect",
    theme_advanced_buttons1_add : "image,cut,copy,paste,pastetext,pasteword,undo,redo,link,unlink",
    theme_advanced_buttons2 : '',
    theme_advanced_buttons3 : '',


    relative_urls : false,
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_source_editor_width : 500,
    theme_advanced_source_editor_height : 500,

    content_css : document.URL.substring(0, document.URL.indexOf('index.php')) + "css/common.css",
    theme_advanced_styles : "Titre 1=tini_title1;Titre 2=tini_title2; Puce=tini_puce;Corps de texte=tini_body;Retrait=tini_retrait",

    extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
    file_browser_callback : "fileBrowserCallBack",
    theme_advanced_resize_horizontal : false,
    theme_advanced_resizing : true,
    apply_source_formatting : false,
    entity_encoding : "numeric",
    forced_root_block : false,
    force_br_newlines : false,
    force_p_newlines : true,
    relative_urls : "false"
});


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