
tinyMCE.init({
	theme : "advanced",
	mode : "exact",
    name:"wyswygtext",

	elements :"PostItemDescTxtArea",
      theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
      theme_advanced_buttons2 : "formatselect,fontselect,fontsizeselect, code",
      theme_advanced_buttons3 : "",
      theme_advanced_toolbar_location : "top",
      theme_advanced_toolbar_align : "left",
      width: '515px',
      height: '300px',
      remove_linebreaks : true,
      remove_redundant_brs : true,
      cleanup_on_startup : true,
      force_br_newlines : false,
      force_p_newlines : false,
      forced_root_block : '', // Needed for 3.x
      theme_advanced_resizing : true,
      theme_advanced_resize_horizontal : false,
      dialog_type : 'modal',
      relative_urls : false,
      remove_script_host : false,
      convert_urls : false,
      apply_source_formatting : false,
      remove_linebreaks : true,
      paste_convert_middot_lists : true,
      paste_remove_spans : true,
      paste_remove_styles : true,
      gecko_spellcheck : true,
      entities : '38,amp,60,lt,62,gt',
      accessibility_focus : false,
	  setup: function (ed) { ed.onKeyDown.add(function (ed, e) {

                var strip = (tinyMCE.activeEditor.getContent()).replace(/(<([^>]+)>)/ig, "");
				document.getElementsByName('Postlimit')[0].value= 5000-strip.length;
                if (strip.length + 1 > 5000) {

                    alert("Your element has exceeded the limit. If you add anymore text it may be truncated when saved.");
                    return false;
                }
                var text = (strip.length + 1) + " Characters out of " + 10 + " Characters.";
                tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + '_path_row'), text);
            });
        }


});


tinyMCE.init({
	theme : "advanced",
	mode : "exact",
    name:"wyswygtext",

	elements :"art_ItemDescTxtArea",
      theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink,formatselect,fontselect,fontsizeselect, code",
      theme_advanced_buttons2 : "",
      theme_advanced_buttons3 : "",
      theme_advanced_toolbar_location : "top",
      theme_advanced_toolbar_align : "left",
      width: '750px',
      height: '400px',
      remove_linebreaks : true,
      remove_redundant_brs : true,
      cleanup_on_startup : true,
      force_br_newlines : false,
      force_p_newlines : false,
      forced_root_block : '', // Needed for 3.x
      theme_advanced_resizing : true,
      theme_advanced_resize_horizontal : false,
      dialog_type : 'modal',
      relative_urls : false,
      remove_script_host : false,
      convert_urls : false,
      apply_source_formatting : false,
      remove_linebreaks : true,
      paste_convert_middot_lists : true,
      paste_remove_spans : true,
      paste_remove_styles : true,
      gecko_spellcheck : true,
      entities : '38,amp,60,lt,62,gt',
      accessibility_focus : false,
	  setup: function (ed) { ed.onKeyDown.add(function (ed, e) {

                var strip = (tinyMCE.activeEditor.getContent()).replace(/(<([^>]+)>)/ig, "");
				document.getElementsByName('Postlimit')[0].value= 5000-strip.length;
                if (strip.length + 1 > 5000) {

                    alert("Your element has exceeded the limit. If you add anymore text it may be truncated when saved.");
                    return false;
                }
                var text = (strip.length + 1) + " Characters out of " + 10 + " Characters.";
                tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + '_path_row'), text);
            });
        }


});



