<link href="{forumpath}templates/{templatepath}/seditor.css" rel="stylesheet" type="text/css" />
<div class="editor_tb">
	<span class="right">
		<%if {topicid}>0%>
		<a href="{rooturl}postreply.aspx?topicid={topicid}&forumpage={forumpageid}" onclick="floatwin('open_reply', '{rooturl}postreply.aspx?topicid={topicid}&forumpage={forumpageid}', 600, 410, '600,0');doane(event);">高级回复</a>
		<span class="pipe">|</span>
		<%/if%>
		<span onmouseover="$('newspecial').id = 'newspecialtmp';this.id = 'newspecial';if($('newspecial_menu').childNodes.length>0)  showMenu(this.id);" id="newspecial" class="postbtn"><a href="{rooturl}posttopic.aspx?forumid={forum.fid}&forumpage={forumpageid}" onclick="floatwin('open_newthread',  '{rooturl}posttopic.aspx?forumid={forum.fid}&forumpage={forumpageid}', 600, 410, '600,0');doane(event);">发新主题</a></span>
	</span>
	<div>
	<!--{if in_array('bold', $seditor[1])}-->
		<a href="javascript:;" title="粗体" class="tb_bold" onclick="seditor_insertunit('{seditorid}', '[b]', '[/b]')">B</a>
	<!--{/if}-->
	<!--{if in_array('color', $seditor[1])}-->
		<a href="javascript:;" title="颜色" class="tb_color" id="{seditorid}forecolor" onclick="showMenu(this.id, true, 0, 2)">Color</a>

		<%set (string){coloroptions} = "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"%>
		<!--{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 tb_color" id="{seditorid}forecolor_menu" style="display: none">
			<%loop (string) colorname coloroptions.Split(comma)%>
				<input type="button" style="background-color: {colorname}" onclick="seditor_insertunit('{seditorid}', '[color={colorname}]', '[/color]')" /><%if {colorname[_id]}%8==0%><br /><%/if%>
			<%/loop%>
		</div>
	<!--{/if}-->
	<!--{if in_array('img', $seditor[1])}-->
		<a href="javascript:;" title="图片" class="tb_img" onclick="seditor_insertunit('{seditorid}', '[img]', '[/img]')">Image</a>
	<!--{/if}-->
	<!--{if in_array('link', $seditor[1])}-->
		<a href="javascript:;" title="链接" class="tb_link" onclick="seditor_insertunit('{seditorid}', '[url]', '[/url]')">Link</a>
	<!--{/if}-->
	<!--{if in_array('quote', $seditor[1])}-->
		<a href="javascript:;" title="引用" class="tb_quote" onclick="seditor_insertunit('{seditorid}', '[quote]', '[/quote]')">Quote</a>
	<!--{/if}-->
	<!--{if in_array('code', $seditor[1])}-->
		<a href="javascript:;" title="代码" class="tb_code" onclick="seditor_insertunit('{seditorid}', '[code]', '[/code]')">Code</a>
	<!--{/if}-->
	<!--{if in_array('smilies', $seditor[1])}-->
	<%if {config.smileyinsert}==1%>
		<a href="javascript:;" class="tb_smilies" id="{seditorid}smilies" onclick="getSmilies(getSmilies_callback);showMenu(this.id, true, 0, 2)">Smilies</a>
	<%/if%>
	<!--{/if}-->
	</div>
</div>
<%if {config.smileyinsert}==1%>
	<div class="smilies" id="{seditorid}smilies_menu" style="display:none;width:315px;">
		
		
		<div class="smilieslist">
			<%set (string){defaulttypname} = string.Empty%>
			<div id="smiliesdiv">
				<div class="smiliesgroup" style="margin-right: 0pt;">
					<ul>
					<%loop stype Caches.GetSmilieTypesCache()%>
						<%if {stype[_id]}==1%>
						<%set {defaulttypname} = {stype[code]}%>
						<%/if%>
						<%if {stype[_id]}==1%>
						<li id="t_s_{stype[_id]}"><a id="s_{stype[_id]}" hidefocus="true" href="javascript:;" onclick="showsmiles({stype[_id]}, '{stype[code]}', 1, '{seditorid}');" class="current">{stype[code]}</a></li>
						<%else%>
						<li id="t_s_{stype[_id]}"><a id="s_{stype[_id]}" hidefocus="true" href="javascript:;" onclick="showsmiles({stype[_id]}, '{stype[code]}', 1, '{seditorid}');">{stype[code]}</a></li>
						<%/if%>
					<%/loop%>
					</ul>
				 </div>
				 <div style="clear: both;" class="float_typeid" id="showsmilie"></div>
				 <table class="smilieslist_table" id="s_preview_table" style="display: none"><tr><td class="smilieslist_preview" id="s_preview"></td></tr></table>
				 <div id="showsmilie_pagenum" class="smilieslist_page">&nbsp;</div>
			</div>
		</div>
		<script type="text/javascript" reload="1">
			//var firstpagesmilies_json ={ {  Caches.GetSmiliesFirstPageCache()  } };
			//showFirstPageSmilies(firstpagesmilies_json, '{defaulttypname}', 16, '{seditorid}');
			function getSmilies(func){
				if($('showsmilie').innerHTML !='' && $('showsmilie').innerHTML != '正在加载表情...')
					return;
				var c = "{forumpath}tools/ajax.aspx?t=smilies";
				_sendRequest(c,function(d){var e={};try{e=eval("("+d+")")}catch(f){e={}}var h=e?e:null;func(h);e=null;func=null},false,true);
				setTimeout("if($('showsmilie').innerHTML=='')$('showsmilie').innerHTML = '正在加载表情...'", 2000);
			}
			function getSmilies_callback(obj) {
				smilies_HASH = obj; 
				showsmiles(1, '{defaulttypname}', 1, '{seditorid}');
			}
		</script>
	</div>
<%/if%>