﻿$(function() {
    var script_url = "/scripts/tiny_mce/tiny_mce.js",
        content_css = "/App_Themes/New/StyleSheet.css",
        plugins = "advlink,advlist,autosave,contextmenu,fullscreen,inlinepopups,paste,searchreplace,spellchecker",
        spellchecker_rpc_url = "/TinyMCE.ashx?module=SpellChecker",
        relative_urls = false,
        remove_script_host = false,
        convert_urls = false
        theme = "advanced",
        theme_advanced_toolbar_location = "top",
        theme_advanced_toolbar_align = "left",
        theme_advanced_buttons1 = "fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,|,sub,sup,|,forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,search,replace",
        theme_advanced_buttons2 = "spellchecker,bullist,numlist,|,outdent,indent,blockquote,|,cut,copy,paste,pastetext,pasteword,|,undo,redo,|,link,unlink,anchor,|,removeformat,cleanup,code,fullscreen",
        theme_advanced_buttons3 = "",
        theme_advanced_statusbar_location = "bottom",
        theme_advanced_resizing = true,
        extended_valid_elements = "iframe[align<bottom?left?middle?right?top|class|frameborder|height|id|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style|title|width]";

    $(".mceEditor").tinymce({
        // General options.
        script_url: script_url,
        content_css: content_css,
        plugins: plugins,
        spellchecker_rpc_url: spellchecker_rpc_url,
        relative_urls: relative_urls,
        remove_script_host: remove_script_host,
        convert_urls: convert_urls,
        extended_valid_elements: extended_valid_elements,

        // Theme options.
        theme: theme,
        theme_advanced_toolbar_location: theme_advanced_toolbar_location,
        theme_advanced_toolbar_align: theme_advanced_toolbar_align,
        theme_advanced_buttons1: theme_advanced_buttons1,
        theme_advanced_buttons2: theme_advanced_buttons2,
        theme_advanced_buttons3: theme_advanced_buttons3,
        theme_advanced_statusbar_location: theme_advanced_statusbar_location,
        theme_advanced_resizing: theme_advanced_resizing
    });

    $(".mceEditor_ReadOnly").tinymce({
        // General options.
        script_url: script_url,
        content_css: content_css,
        plugins: plugins,
        spellchecker_rpc_url: spellchecker_rpc_url,
        relative_urls: relative_urls,
        remove_script_host: remove_script_host,
        convert_urls: convert_urls,
        extended_valid_elements: extended_valid_elements,

        // Theme options.
        theme: theme,
        theme_advanced_toolbar_location: theme_advanced_toolbar_location,
        theme_advanced_toolbar_align: theme_advanced_toolbar_align,
        theme_advanced_buttons1: theme_advanced_buttons1,
        theme_advanced_buttons2: theme_advanced_buttons2,
        theme_advanced_buttons3: theme_advanced_buttons3,
        theme_advanced_statusbar_location: theme_advanced_statusbar_location,
        theme_advanced_resizing: theme_advanced_resizing,
        readonly: 1
    });
});
