<table class="etable"> 
	<tr>
		<td width="100">站名：</td>
		<td><input type="text" name="name" value="<{$row.name}>" size="38" id="name"/></td>
	</tr> 
	<tr>
		<td>链接：</td>
		<td><input type="text" name="link" value="<{$row.link}>" size="38" id="link"/></td>
	</tr>
	<tr>
		<td>排序：</td>
		<td><input type="text" name="px" value="<{if $row.px}><{$row.px}><{else}>0<{/if}>" size="20" id="px"/></td>
	</tr> 
	<tr>
		<td>状态：</td>
		<td>
			<label><input type="radio" name="status" value="1" <{if $smarty.get.id == '' || $row.status == '1'}>checked="checked"<{/if}>/>开启</label>
			<label><input type="radio" name="status" value="0" <{if $row.status == '0'}>checked="checked"<{/if}>/>关闭</label> 
		</td>
	</tr>
</table> 
<script type="text/javascript">
function ajax_submit(){
	var name = $("#name").val(); 
	var link = $("#link").val();  
	var px = $("#px").val();
	var status = $('input[name="status"]:checked').val();
	$.post('?m=ad&a=link_save',{<{if $row.id}>id:<{$row.id}>,<{/if}>name:name, link:link, px:px, status:status},function(result){
		data = jQuery.parseJSON(result); 
		if(data.error == '0'){
			parent.ajax_flush();
			parent.ajax_close();
		}else{
			alert(data.msg);
		} 
	}); 
}
</script>
 