tinyMCE.init({
    convert_urls : true,
    mode : "textareas",
    language : "es",
    theme : "advanced",
    theme_advanced_buttons1 : "bold,italic,underline,separator,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,separator,undo,redo,separator,fontsizeselect, forecolor",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    extended_valid_elements : "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
    entity_encoding : "raw",
    convert_fonts_to_spans : true,
    font_size_style_values : "10,12,14,16,18,20,22",
    plugins : "paste",
    paste_insert_word_content_callback : "convertWord",
    paste_auto_cleanup_on_paste : true
});
function convertWord (type, content) {
    switch (type) {
        // Gets executed before the built in logic performs it's cleanups
        case "before":
            //content = content.toLowerCase(); // Some dummy logic
            //alert(content);
            break;
        // Gets executed after the built in logic performs it's cleanups
        case "after":
            //alert(content);
            content = content.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g,'');
            //content = content.toLowerCase(); // Some dummy logic
            //alert(content);
            break;
    }
    return content;
}

