
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "advanced",
		language : "ja",
		plugins : "pagebreak,style,layer,table,advhr,advimage,emotions,iespell,inlinepopups,insertdatetime,preview,searchreplace,contextmenu,paste,noneditable,visualchars",

		// Theme options
		theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,|,undo,redo,|,forecolor,backcolor,|,emotions",
		theme_advanced_buttons2 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
		theme_advanced_fonts : "ゴシック体=MS UI Gothic,\'ヒラギノ角ゴ Pro W3\',sans-serif;明朝体=\'ＭＳ Ｐ明朝\',\'ヒラギノ明朝 Pro W3\',serif",
		init_instance_callback: "myCustomInitInstance",

		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",
		font_size_style_values : "7pt,10pt,12pt,14pt,18pt,24pt,36pt",

        forced_root_block : false,
        force_br_newlines : true,
        force_p_newlines : false
	});

	var onmouse = true;
	window.onload = function() {
		var container, tiny_l = 0, tiny_t = 0, tiny_r = 0, tiny_b = 0;
		document.body.onmousemove = function () {
			if (tinymce.isIE && tinymce.activeEditor) {
				container = tinymce.activeEditor.getContainer();
				tiny_l = container.getBoundingClientRect().left;
				tiny_t = container.getBoundingClientRect().top;
				tiny_b = container.getBoundingClientRect().bottom;
				if (tiny_r == 0) { tiny_r = container.getBoundingClientRect().right; }
				if (event.clientX >= tiny_l && event.clientX <= tiny_r && event.clientY >= tiny_t && event.clientY <= tiny_b) {
					onmouse = true;
				} else {
					onmouse = false;
				}
			}
			return false;
		}
	}

	function myCustomInitInstance(inst) {
	    tinymce.dom.Event.add(inst.getWin(), 'blur', function(e) {
	    	var element;
	    	var id = new Array(5);
	    	id[0] = "menu_comments_comments_fontselect_menu";
	    	id[1] = "menu_comments_comments_fontsizeselect_menu";
	    	id[2] = "comments_forecolor_menu";
	    	id[3] = "comments_backcolor_menu";
	    	id[4] = "mceModalBlocker";
	    	for (var i = 0;i < id.length;i++) {
		    	element = document.getElementById(id[i]);
		    	if (element && element.style.display != "none") { return; }
	    	}
	    	if (tinymce.isIE && onmouse) { return; }
	    	element = tinymce.activeEditor.getElement();
    		element.onblur(e);
	    });
	}

