<%if  {canpostattach} && {postinfo.attachment}>0%>
	<table summary="附件" cellspacing="0" cellpadding="0" width="100%">
		<%loop attachment attachmentlist%>
		<%if {strtoint({attachment[pid]})}=={postinfo.pid}%>
		<script type="text/javascript" reload="1">try{ $("num2upload").innerHTML=--num2upload; }catch(e) { setTimeout('$(\'num2upload\').innerHTML=--num2upload;', 1000); }</script>
		<tbody id="attach_{attachment[aid]}">
			<tr>
				<td class="attachnum"><img src="images/attachicons/common.gif" /></td>
				<td class="attachctrl">
						<a href="javascript:;"<%if {attachment[filetype]}.IndexOf("image")>-1%> onmouseover="showpreview(this, 'imgpreview_{attachment[aid]}')"<%/if%> onclick="<%if {attachment[filetype]}.IndexOf("image")>-1%>insertAttachimgTag('{attachment[aid]}');<%else%>insertAttachTag('{attachment[aid]}');<%/if%>" title="点击这里将本附件插入帖子内容中当前光标的位置">插入</a>
						<script type="text/javascript" reload="1">var attachimgurl_{attachment[aid]} = ['attachment.aspx?attachmentid={attachment[aid]}', 400];</script>
						<input type="hidden" value="{attachment[aid]}" name="attachupdateid" />
				</td>
				<td class="attachname" title="{attachment[filename]}  {attachment[postdatetime]}  {attachment[filesize]} 字节  下载{attachment[downloads]}次">
					<a href="javascript:;" class="right" onclick="attachupdate('{attachment[aid]}', this)">更新</a>
					<div id="attach{attachment[aid]}">
						<p>
							<input type="hidden" name="attachupdatedesc" value="{attachment[description]}"  />
							<a href="javascript:;" onclick="parentNode.innerHTML='<input type=\'text\' name=\'attachupdatedesc\' value=\'{attachment[description]}\' size=\'25\' class=\'txt\' />'">描述</a>
							<span<%if {attachment[filetype]}.IndexOf("image")>-1%> onmouseover="showpreview(this, 'imgpreview_{attachment[aid]}');"<%/if%>>{attachment[attachment]}</span>
						</p>
						<%if {attachment[filetype]}.IndexOf("image")>-1%>
							<div id="imgpreview_{attachment[aid]}" style="display: none; "><img id="preview_{attachment[aid]}" style=" max-width: 200px; max-height: 200px" src="attachment.aspx?attachmentid={attachment[aid]}" onerror="this.onerror=null;try{  this.src=attachimgurl_{attachment[aid]}; } catch(e){}" /></div>
						<%/if%>
					</div>
					<span id="attachupdate{attachment[aid]}"></span>
				</td>
				<%if {userid}!=-1 && {usergroupinfo.Allowsetattachperm}==1%><td class="attachview"><input name="attachupdatereadperm" value="{attachment[readperm]}" size="1" class="txt" /></td><%/if%>
				<%if {topicattachscorefield}>0 && usergroupinfo.Maxprice>0%><td class="attachpr"><input name="attachupdateprice" value="{attachment[attachprice]}" size="1" class="txt" /></td><%/if%>
				<td class="attachdel"><input class="checkbox" name="deleteaid" value="{attachment[aid]}" type="checkbox">删?</td>
			</tr>
			</tbody>
			<%/if%>
			<%/loop%>
	</table>
<%/if%>