 function load_TinyMCE_forum(xid) {
	if (!xid) xid = "html";
	if (!window.mce_forum) {
		tinyMCE.init({
			plugins : "safari,paste,emotions",
			theme_advanced_buttons1 : "bold,italic,underline,strikethrough,sub,sup,|,bullist,numlist,blockquote,|,emotions,|,undo,redo",
			theme_advanced_buttons2 : "",
			theme_advanced_buttons3 : "",
			theme_advanced_toolbar_location : "bottom",
			theme_advanced_toolbar_align : "left",
			accessibility_warnings : false,
			relative_urls : false,
			mode : "textareas",
			theme : "advanced",
			editor_selector: "TinyMCE",
			language : "ru",
			file_browser_callback : "browser",
			content_css : "/SiteNN/TinyMCE/context.css",
			valid_elements: "br,div,p,b/strong,i/em,u,ul,ol,li,sub,sup,strike,strikethrough,blockquote,a[href|target],img[src|alt]",
			force_br_newlines : true,
			forced_root_block : '',
			cleanup_on_startup : true,
			paste_auto_cleanup_on_paste : true,
			remove_trailing_nbsp : true,
			inline_styles : false
		});
		window.mce_forum = xid;
	}
}
function reply(id, quote) {
	var form = document.getElementById("publishForm");
	if (form && form.reply) form.reply.value = id;
	if (1) {
		var t;
		var o = "Ответ";
		t = document.getElementById(id + "_user");
		if (t) o += " пользователю " + "<b>" + t.innerHTML + "</b>";
		t = document.getElementById(id + "_date");
		if (t) o += " на сообщение от " + t.innerHTML;
		t = document.getElementById("quot");
		if (t) t.innerHTML = o;
	}
	if (quote == "qq") {
		if (document.getElementById(id + "_body")) {
			var html = document.getElementById(id + "_body").innerHTML;
			if (typeof(tinyMCE) != "undefined") {
				var tiny = tinyMCE.selectedInstance;
				if (tiny) tiny.setContent("<blockquote>" + html + "</blockquote><br/>" + tiny.getContent());
			} else if (form && form.html) {
				html = html.replace(/^/m, "> ");
				form.html.value = html + "\n" + form.html.value;
			}
		}
	}
}

