<link rel="stylesheet" type="text/css" id="css" href="$supe[siteurl]/templates/default/css/group_editor.css" />

<script type="text/javascript">
	var editorid = '$editorid';
	var wysiwyg = (is_ie || is_moz || (is_opera >= 9)) && parseInt('$editormode') && bbinsert == 1 ? 1 : 0;
	var allowswitcheditor = parseInt('$allowswitcheditor');
	var allowhtml = parseInt('$allowhtml');
	var forumallowhtml = parseInt('$forum[allowhtml]');
	var allowsmilies = parseInt('$forum[allowsmilies]');
	var allowbbcode = parseInt('$forum[allowbbcode]');
	var allowimgcode = parseInt('$forum[allowimgcode]');
	var smilies = new Array();
	<!--{if !empty($GLOBALS['_DCACHE']['smilies']) && is_array($GLOBALS['_DCACHE']['smilies'])}-->
		<!--{loop $_DCACHE['smilies_display'] $key $smiley}-->
		<!--{eval $smiley[code]=addcslashes($smiley['code'], '\\\'');}-->
			smilies[$key]			= {'code' : '$smiley[code]', 'url' : '$smiley[url]'};
		<!--{/loop}-->
	<!--{/if}-->
	var BORDERCOLOR = "{BORDERCOLOR}";
	var ALTBG2 = "{ALTBG2}";
	var charset = '$charset';

	function previewpost(){
		if(!validate($('postform'), true)) {
			$('subject').focus();
			return;
		}
		$("previewmessage").innerHTML = '<span class="bold"><span class="smalltxt">' + $('subject').value + '</span></span><br><br><span style="font-size: {MSGFONTSIZE}">' + bbcode2html($('postform').message.value) + '</span>';
		$("previewtable").style.display = '';
		window.scroll(0, 0);
	}

	function clearcontent() {
		if(wysiwyg && bbinsert) {
			editdoc.body.innerHTML = is_moz ? '<br />' : '';
		} else {
			textobj.value = '';
		}
	}

	function resizeEditor(change) {
		var editorbox = bbinsert ? editbox : textobj;
		var newheight = parseInt(editorbox.style.height, 10) + change;
		if(newheight >= 100) {
			editorbox.style.height = newheight + 'px';
		}
	}
	var lang = new Array();
	if(is_ie >= 5 || is_moz >= 2) {
		window.onbeforeunload = function () {saveData(wysiwyg && bbinsert ? editdoc.body.innerHTML : textobj.value)};
		lang['post_autosave_none'] = "{lang post_autosave_none}";
		lang['post_autosave_confirm'] = "{lang post_autosave_confirm}";
	}
</script>
<script type="text/javascript" src="include/javascript/bbcode.js"></script>
<!--{if $bbinsert}-->
	<script type="text/javascript" src="include/javascript/editor.js"></script>
	<script type="text/javascript">
		lang['enter_list_item']			= "{lang post_discuzcode_listitem}";
		lang['enter_link_url']			= "{lang post_discuzcode_linkurl}";
		lang['enter_image_url']			= "{lang post_discuzcode_imageurl}";
		lang['enter_email_link']		= "{lang post_discuzcode_emaillink}";
		lang['fontname']			= "{lang post_discuzcode_fontname}";
		lang['fontsize']			= "{lang post_discuzcode_fontsize}";
		var custombbcodes = new Array();
		<!--{if $forum['allowbbcode'] && $allowcusbbcode}-->
			<!--{loop $_DCACHE['bbcodes_display'] $tag $bbcode}-->
				custombbcodes["$tag"] = {'example' : '$bbcode[example]', 'prompt' : '$bbcode[prompt]'};
			<!--{/loop}-->
		<!--{/if}-->
		var fontoptions = new Array({lang post_discuzcode_fontoptions});
	</script>
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="editor">
	<tr>
	<td id="{$editorid}_controls" colspan="2">

	<table cellpadding="0" cellspacing="0" border="0">
	<tr>

	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_removeformat" onclick="discuzcode('removeformat')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_removeformat.gif" width="21" height="20" title="{lang post_discuzcode_removeformat}" alt="{lang post_discuzcode_removeformat}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_undo" onclick="discuzcode('undo')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_undo.gif" width="21" height="20" title="{lang post_discuzcode_undo}" alt="{lang post_discuzcode_undo}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_redo" onclick="discuzcode('redo')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_redo.gif" width="21" height="20" title="{lang post_discuzcode_redo}" alt="{lang post_discuzcode_redo}" /></div></td>

	<td><img src="images/common/bb_separator.gif" width="6" height="20" alt="" /></td>

	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_bold" onClick="discuzcode('bold')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_bold.gif" width="21" height="20" title="{lang post_discuzcode_bold}" alt="{lang post_discuzcode_bold}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_italic" onclick="discuzcode('italic')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_italic.gif" width="21" height="20" title="{lang post_discuzcode_italic}" alt="{lang post_discuzcode_italic}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_underline" onclick="discuzcode('underline')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_underline.gif" width="21" height="20" title="{lang post_discuzcode_underline}" alt="{lang post_discuzcode_underline}" /></div></td>

	<td><img src="images/common/bb_separator.gif" width="6" height="20" alt="" /></td>

	<td id="{$editorid}_popup_fontname" title="{lang post_discuzcode_fontname}" onclick="editorMenu(this)"><div class="editor_buttonnormal" onMouseOver="menuContext(this, 'mouseover')" onMouseOut="menuContext(this, 'mouseout')">
	<table cellpadding="0" cellspacing="0" border="0" unselectable="on">
	<tr>
	<td class="editor_menunormal" unselectable="on" id="{$editorid}_menu_fontname"><div id="{$editorid}_font_out" style="width:91px" unselectable="on">{lang post_discuzcode_fontname}</div></td>
	<td unselectable="on"><img src="images/common/bb_menupop.gif" width="7" height="4" alt="" /></td>
	</tr>
	</table>
	</div></td>

	<td id="{$editorid}_popup_fontsize" title="{lang post_discuzcode_fontsize}" onclick="editorMenu(this)"><div class="editor_buttonnormal" onMouseOver="menuContext(this, 'mouseover')" onMouseOut="menuContext(this, 'mouseout')">
	<table cellpadding="0" cellspacing="0" border="0" unselectable="on">
	<tr>
	<td class="editor_menunormal" unselectable="on" id="{$editorid}_menu_fontsize"><div id="{$editorid}_size_out" style="width:25px" unselectable="on">{lang post_discuzcode_fontsize}</div></td>
	<td unselectable="on"><img src="images/common/bb_menupop.gif" width="7" height="4" alt="" /></td>
	</tr>
	</table>
	</div></td>

	<td id="{$editorid}_popup_forecolor" title="{lang post_discuzcode_forecolor}" onclick="editorMenu(this)"><div class="editor_buttonnormal" onMouseOver="menuContext(this, 'mouseover')" onMouseOut="menuContext(this, 'mouseout')">
	<table cellpadding="0" cellspacing="0" border="0" unselectable="on">
	<tr>
	<td class="editor_colormenunormal" unselectable="on" id="{$editorid}_colormenu"><img src="images/common/bb_color.gif" width="21" height="16" alt="" /><br><img src="images/common/bb_clear.gif" id="{$editorid}_color_bar" alt="" style="background-color:black" width="21" height="4" /></td>
	<td unselectable="on"><img src="images/common/bb_menupop.gif" width="7" height="4" alt="" /></td>
	</tr>
	</table>
	</div></td>

	<td><img src="images/common/bb_separator.gif" width="6" height="20" alt="" /></td>

	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_justifyleft" onclick="discuzcode('justifyleft')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_left.gif" width="21" height="20" title="{lang post_discuzcode_left}" alt="{lang post_discuzcode_left}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_justifycenter" onclick="discuzcode('justifycenter')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_center.gif" width="21" height="20" title="{lang post_discuzcode_center}" alt="{lang post_discuzcode_center}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_justifyright" onclick="discuzcode('justifyright')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_right.gif" width="21" height="20" title="{lang post_discuzcode_right}" alt="{lang post_discuzcode_right}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_floatleft" onclick="discuzcode('floatleft')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_floatleft.gif" width="21" height="20" title="{lang post_discuzcode_floatleft}" alt="{lang post_discuzcode_floatleft}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_floatright" onclick="discuzcode('floatright')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_floatright.gif" width="21" height="20" title="{lang post_discuzcode_floatright}" alt="{lang post_discuzcode_floatright}" /></div></td>

	<td><img src="images/common/bb_separator.gif" width="6" height="20" alt="" /></td>

	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_insertorderedlist" onclick="discuzcode('insertorderedlist')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_orderedlist.gif" width="21" height="20" title="{lang post_discuzcode_orderedlist}" alt="{lang post_discuzcode_orderedlist}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_insertunorderedlist" onclick="discuzcode('insertunorderedlist')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_unorderedlist.gif" width="21" height="20" title="{lang post_discuzcode_unorderedlist}" alt="{lang post_discuzcode_unorderedlist}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_outdent" onclick="discuzcode('outdent')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_outdent.gif" width="21" height="20" title="{lang post_discuzcode_outdent}" alt="{lang post_discuzcode_outdent}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_indent" onclick="discuzcode('indent')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_indent.gif" width="21" height="20" title="{lang post_discuzcode_indent}" alt="{lang post_discuzcode_indent}" /></div></td>

	</tr>
	</table>

	<table cellpadding="0" cellspacing="0" border="0">
	<tr>

	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_createlink" onclick="discuzcode('createlink')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_url.gif" width="21" height="20" title="{lang post_discuzcode_url}" alt="{lang post_discuzcode_url}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_unlink" onclick="discuzcode('unlink')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_unlink.gif" width="21" height="20" title="{lang post_discuzcode_unlink}" alt="{lang post_discuzcode_unlink}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_email" onclick="discuzcode('email')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_email.gif" width="21" height="20" title="{lang post_discuzcode_email}" alt="{lang post_discuzcode_email}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_insertimage" onclick="discuzcode('insertimage')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_image.gif" width="21" height="20" title="{lang post_discuzcode_image}" alt="{lang post_discuzcode_image}" /></div></td>

	<td><img src="images/common/bb_separator.gif" width="6" height="20" alt="" /></td>

	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_wrap0_quote" onclick="discuzcode('quote')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_quote.gif" width="21" height="20" title="{lang post_discuzcode_quote}" alt="{lang post_discuzcode_quote}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_wrap0_code" onclick="discuzcode('code')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_code.gif" width="21" height="20" title="{lang post_discuzcode_code}" alt="{lang post_discuzcode_code}" /></div></td>
	<td><div class="editor_buttonnormal" id="{$editorid}_popup_table" onclick="editorMenu(this)" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_table.gif" width="21" height="20" title="{lang post_discuzcode_table}" alt="{lang post_discuzcode_table}" /></div></td>

	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_free" onclick="discuzcode('free')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_free.gif" width="21" height="20" title="{lang post_discuzcode_free}" alt="{lang post_discuzcode_free}" /></div></td>
	<!--{if $allowhidecode}--><td><div class="editor_buttonnormal" id="{$editorid}_cmd_hide" onclick="discuzcode('hide')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_hide.gif" width="21" height="20" title="{lang post_discuzcode_hide}" alt="{lang post_discuzcode_hide}" /></div></td><!--{/if}-->

	<td><img src="images/common/bb_separator.gif" width="6" height="20" alt="" /></td>
	<!--{if $forum['allowbbcode'] && $allowcusbbcode}-->
	<!--{loop $_DCACHE['bbcodes_display'] $tag $bbcode}-->
	<td><div class="editor_buttonnormal" id="{$editorid}_cmd_custom{$bbcode[params]}_$tag" onclick="discuzcode('custom{$bbcode[params]}_$tag')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/$bbcode[icon]" width="21" height="20" title="$bbcode[explanation]" alt="$tag" /></div></td>
	<!--{/loop}-->
	<!--{/if}-->
	</tr>
	</table>
	<br>

	<div id="{$editorid}_switcher">
	<input type="button" id="bbcodemode" value="{lang editor_mode_discuzcode}" onclick="switchEditor(0)" class="editor_switcher_highlight">
	<input type="button" id="wysiwygmode" value="{lang editor_mode_wysiwyg}" onclick="switchEditor(1)" class="editor_switcher">
	</div>

	<!--{eval $fontoptions = array({lang post_discuzcode_fontoptions})}-->
	<div class="popupmenu_popup" id="{$editorid}_popup_fontname_menu" style="display: none">
	<table cellpadding="4" cellspacing="0" border="0" unselectable="on">
	<!--{loop $fontoptions $fontname}-->
		<tr><td class="popupmenu_option" onClick="discuzcode('fontname', '$fontname')" unselectable="on"><font face="$fontname" unselectable="on">$fontname</font></td></tr>
	<!--{/loop}-->
	</table></div>

	<!--{eval $sizeoptions = array(1, 2, 3, 4, 5, 6, 7)}-->
	<div class="popupmenu_popup" id="{$editorid}_popup_fontsize_menu" style="display: none">
	<table cellpadding="4" cellspacing="0" border="0" unselectable="on">
	<!--{loop $sizeoptions $size}-->
		<tr align="center"><td class="popupmenu_option" onClick="discuzcode('fontsize', $size)" unselectable="on"><font size="$size" unselectable="on">$size</font></td></tr>
	<!--{/loop}-->
	</table></div>

	<!--{eval $coloroptions = array('Black', 'Sienna', 'DarkOliveGreen', 'DarkGreen', 'DarkSlateBlue', 'Navy', 'Indigo', 'DarkSlateGray', 'DarkRed', 'DarkOrange', 'Olive', 'Green', 'Teal', 'Blue', 'SlateGray', 'DimGray', 'Red', 'SandyBrown', 'YellowGreen', 'SeaGreen', 'MediumTurquoise', 'RoyalBlue', 'Purple', 'Gray', 'Magenta', 'Orange', 'Yellow', 'Lime', 'Cyan', 'DeepSkyBlue', 'DarkOrchid', 'Silver', 'Pink', 'Wheat', 'LemonChiffon', 'PaleGreen', 'PaleTurquoise', 'LightBlue', 'Plum', 'White')}-->
	<div class="popupmenu_popup" id="{$editorid}_popup_forecolor_menu" style="display: none">
	<table cellpadding="4" cellspacing="0" border="0" unselectable="on"><tr>
	<!--{loop $coloroptions $key $colorname}-->
		<td class="editor_colornormal" onClick="discuzcode('forecolor', '$colorname')" unselectable="on" onMouseOver="colorContext(this, 'mouseover')" onMouseOut="colorContext(this, 'mouseout')"><div style="background-color: $colorname" unselectable="on"></div></td><!--{if ($key + 1) % 8 == 0}--></tr><tr><!--{/if}-->
	<!--{/loop}-->
	</tr></table></div>

	<div class="popupmenu_popup" id="{$editorid}_popup_table_menu" style="display: none" title="menu">
	<table cellpadding="4" cellspacing="0" border="0" unselectable="on">
	  <tr class="popupmenu_option">
	    <td>{lang post_discuzcode_tablerows}</td>
	    <td><input type="text" name="rows" id="{$editorid}_table_rows" size="5" value="2" /></td>
	    <td>{lang post_discuzcode_tablecolumns}</td>
	    <td><input type="text" name="columns" id="{$editorid}_table_columns" size="5" value="2" /></td>
	  </tr>
	  <tr class="popupmenu_option">
	    <td>{lang post_discuzcode_tablewidth}</td>
	    <td><input type="text" name="width" id="{$editorid}_table_width" size="5" value="" /></td>
	    <td>{lang post_discuzcode_tablebgcolor}</td>
	    <td><input type="text" name="bgcolor" id="{$editorid}_table_bgcolor" size="5" /></td>
	  </tr>
	  <tr class="popupmenu_option">
	    <td colspan="2" align="right"><input type="button" onclick="discuzcode('table')" value="{lang submit}" /></td>
	    <td colspan="2" align="left"><input type="button" onClick="hideMenu()" value="{lang cancel}" /></td>
	  </tr>
	</table></div>

	</td>
	</tr>
	</table>
<!--{else}-->
	<div class="editor_line"></div>
<!--{/if}-->