<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<table class="tbl_list" width="100%">
	<tr class="thead">
		<td width="10%">序号</td>
		<td width="35%">专题名</td>
		<td width="35%">所属频道</td>
		<td width="20%">操作</td>
	</tr>	
	<!--{foreach from=$topicList item=item name=foo}-->	
	<tr onmouseover="chgTrColor(this)" onmouseout="chgTrColor(this)">
		<td>
			<!--{$smarty.foreach.foo.index+1}-->
			<input type="hidden" name="topicIds" value="<!--{$item.id}-->">
		</td>
		<td><input id="topicName<!--{$smarty.foreach.foo.index+1}-->" name="topicNames" type="text"  readonly="readonly"  style="border:none;" value="<!--{$item.topic_name}-->"></td>
		<td><!--{$channel.channel_text}--></td>
		<script>
		$("#fun<!--{$smarty.foreach.foo.index+1}-->").click(function(){
			$("#topicName<!--{$smarty.foreach.foo.index+1}-->").attr("style","border:inherit 1px");
			$("#topicName<!--{$smarty.foreach.foo.index+1}-->").attr("readonly","");
		});
		</script>
		<td><a href="#"  style="text-decoration:none" id="fun<!--{$smarty.foreach.foo.index+1}-->"><span id="topicName<!--{$smarty.foreach.foo.index+1}-->"><font color="red">修改</font></span></a>&nbsp;<a href="#"  style="text-decoration:none" onclick="deleteTopic(<!--{$item.id}-->,<!--{$channel.id}-->)"><font color="red">删除</font></a></td>
	</tr>
	<!--{/foreach}-->	
	<tr>
		<td colspan=4  align="right"><button onclick="batchUpadteTopic(<!--{$channel.id}-->)">保存</button></td>	
	</tr>
	<tr>
		<td colspan=4><input type="text" id="topicNameInput">&nbsp;<button onclick="addTopic('topicNameInput',<!--{$channel.id}-->)">新增</button></td>	
	</tr>
</table>
<script>

$("#topic_select").attr('length',1);
<!--{foreach from=$topicList item=item name=foo}-->	
var option = document.createElement("option");
option.text = "<!--{$item.topic_name}-->"; 
option.value = <!--{$item.id}-->; 
$("#topic_select")[0].options.add(option);
<!--{/foreach}-->
 
</script>