tinyMCE.init({
	theme : "advanced",
	mode : "textareas",
    language: "ru",
    plugins : "paste,emotions",
	
	theme_advanced_buttons1 : "bold,italic,underline,emotions,undo,redo,link,unlink,image,removeformat,cleanup,code, pagebreak",
	//theme_advanced_buttons2 : "smile01,smile02,smile03,smile04,smile05,smile06",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	//theme_advanced_styles : "Code=codeStyle;Quote=quoteStyle",
	content_css : "/assets/design/common.css",
	entity_encoding : "named",
	add_unload_trigger : false,
	remove_linebreaks : false,
	inline_styles : false,
	convert_fonts_to_spans : false,
	keep_styles : false,
	gecko_spellcheck : true,
	fix_list_elements : true,
	fix_table_elements : true,
	fix_nesting : true,
	verify_html : true,
	theme_advanced_resizing : true,
	theme_advanced_statusbar_location : "bottom",
	relative_urls : false,
	remove_script_host : true,
	width: "100%",
	

	
	/* paste plugin */
	theme_advanced_buttons1_add : "pastetext,pasteword,selectall",
	paste_create_paragraphs : true,
	paste_create_linebreaks : false,
	paste_use_dialog : false,
	paste_auto_cleanup_on_paste : true,
	paste_convert_middot_lists : false,
	paste_unindented_list_class : "unindentedList",
	paste_convert_headers_to_strong : true,
	
	setup : function(ed) {
	    ed.onKeyPress.add(function(ed, e) {
	        //console.debug('Key press event: ' + e.keyCode);
	    	if (e.ctrlKey && (e.keyCode == 13 || e.keyCode == 10)) {
	    		processComment();
	    		dojo.byId("postComment").submit();
	    	}
	    });
 	}

	
});

