<form action="link.manage.php?action=update" method="post" enctype="multipart/form-data" name="form1" id="form1" style="padding-bottom:20px">
	<table class="from_table">
	  <tr>
	      <th class="th2"><tpl> $langLinkWord </tpl>：</th>
		  <td width="530" class="td1"><input type="text" name="txt_title" id="txt_title" class="txtinput" value="<tpl> $link_array.link_title </tpl>" />
		    <label style="display:none" for="txt_title" class="wrong" metaDone="true" generated="true"></label>	    </td>
      </tr>
	  <tr>
	      <th class="th2"><tpl> $langLinkJump </tpl>：</th>
		  <td width="530"  class="vtop tips2"><input type="text" name="txt_url" id="txt_url" class="txtinput" value="<tpl> $link_array.link_url|default:'http://' </tpl>" />　<tpl> $langLinkAnnotateFillIn </tpl>
			 <label style="display:none" for="txt_url" class="wrong" metaDone="true" generated="true"></label>	    </td>
      </tr>
	  <tr>
	      <th class="th2"><tpl> $langLinkImage </tpl>：</th>
		  <td width="530" class="td1"><tpl> if $link_array.link_pic neq '' </tpl><img src="<tpl> $site_url </tpl>/<tpl> $link_array.link_pic </tpl>" border="0" style="vertical-align:middle; margin-left:10px;margin-right:10px; width:<tpl> $link_info.pic_width </tpl>px; height:<tpl> $link_info.pic_height </tpl>px" />
				<span class="btn_left"><input type="button" id="delbutton" class="btn_submit" name="delbutton" value="<tpl> $langLinkDel </tpl>" /></span>
			<tpl> else </tpl>
				<input name="txt_pic" id="txt_pic" type="file" />
			<tpl> /if </tpl></td>
      </tr>
	  <tr>
	      <th class="th2"><tpl> $langCSort </tpl>：</th>
		  <td width="530" class="td1"><input type="text" name="txt_sort" id="txt_sort" class="txtinput" value="<tpl> $link_array.link_sort|default:'0' </tpl>" />
			  <label style="display:none" for="txt_sort" class="wrong" metaDone="true" generated="true"></label>	    </td>
      </tr>
	  <tr>
	      <th class="th2"><tpl> $langLinkDisFashion </tpl>：</th>
		  <td width="530" class="td1"><input name="txt_type" type="radio" value="0" 
		  		<tpl> if $link_array.link_type eq '0' || $link_array.link_type eq '' </tpl> checked="checked"<tpl> /if </tpl> /><tpl> $langLinkImage </tpl>
				<input name="txt_type" type="radio" value="1" <tpl> if $link_array.link_type eq '1' </tpl> checked="checked"<tpl> /if </tpl> /><tpl> $langLinkWord </tpl></td>
      </tr>
	  <tr>
	      <th class="th2"><tpl> $langLinkWhetherClose </tpl>：</th>
		  <td width="530" class="td1">
	             <input name="txt_close" type="radio" value="0" 
				<tpl> if $link_array.link_close eq '0' </tpl> checked="checked"<tpl> /if </tpl> /><tpl> $langCNo </tpl>
				<input name="txt_close" type="radio" value="1" <tpl> if $link_array.link_close eq '1' </tpl> checked="checked"<tpl> /if </tpl> /><tpl> $langCYes </tpl></td>
      </tr>	
	  <tr>
	      <td>
		</td>
          <td width="530">
		  	<span class="btn_left">
		  	<input value="<tpl> $langLinkSubmit </tpl>" type="submit" class="btn_submit"/></span>
			<input type="hidden" name="link_id" id="link_id" value="<tpl> $link_array.link_id </tpl>" />
	</td>
	  </tr>
  </table>
</form>
<div id="question" style="display:none; cursor: default; padding:10px"> 
        <b style=" font-size:14px; margin-top:10px; line-height:50px; height:50px;padding-

top:10px; padding-bottom:10px"><tpl> $langLinkConfirmDelete </tpl></b> <br />
        <input type="button" id="yes" value="<tpl> $langCYes </tpl>"  style=" border:1px solid 

#CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/> 
        <input type="button" id="no" value="<tpl> $langCNo </tpl>"  style="border:1px solid #CCCCCC;width:80px; 

margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/>
		<input type="hidden" id="del_value" />
</div> 
<script>
$(document).ready(function() {
	var options = {
		beforeSubmit:  function(){showLoading(showSaveText);},
		success:       function(msg){
							hideLoading();
							showMessage(msg.message,msg.type);
							if(msg.type == '1'){
								ShowDiv = "result_content";
								getPageContent("link.manage.php?action=ajax_list&select_type="+<tpl> $select_type </tpl>);
							}
						},
		type:      'post',
		dataType:  'json'
	};
	
	//对表单做的验证定义
	$("#form1").validate({
		errorClass: "wrong",
		rules: {
			txt_title: {required:true},
			txt_url: {required:true},
			txt_sort: {required:true,number:true}
		},
		messages: {
			txt_title: {required:"<tpl> $langLinkWordNotNull </tpl>"},
			txt_url: {required:"<tpl> $langLinkJumpNotNull </tpl>"},
			txt_sort: {required:"<tpl> $langLinkSortNotNull </tpl>",number:"<tpl> $langLinkSerialNumberIsNum </tpl>"}
		},
		submitHandler: function() {
			$('#form1').ajaxSubmit(options);
		}
	});
	
	
	//删除图片
	var question = $('#question')[0];
	$("#delbutton").click(function(){
		$.blockUI(question, { width: '275px' });
	});
	
	$('#yes').click(function() {
			$.unblockUI();
			
			$.ajax({
				url: "link.manage.php",
				data: 'action=del_pic&link_id='+<tpl> $link_array.link_id </tpl>,
				type:'post',
				dataType:"json",
				beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
				success: function(msg){
					hideLoading();
					showMessage(msg.message,msg.type);
					if(msg.type == 1){
						ShowDiv = "result_content";
						getPageContent("link.manage.php?action=modi&link_id="+<tpl> $link_array.link_id </tpl>+"&select_type="+<tpl> $select_type </tpl>);
					}
				}
			});
			return false;
		});
	$('#no').click($.unblockUI);
});	
</script>