<form action="link.manage.php?action=save" 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" />
		    <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="http://" /><tpl> $langLinkAnnotateFillIn </tpl>'http://'<tpl> $langLinkOr </tpl>'https://'
			<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"><input name="txt_pic" id="txt_pic"  class="txtinput"  type="file" /></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="0" />
			  <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" checked="checked" /><tpl> $langLinkImage </tpl>
				<input name="txt_type" type="radio" value="1" /><tpl> $langLinkWord </tpl>		  </td>
      </tr>
	  
  </table>
  <div class="table-5-bottom"> <div class="p-left-2"><span class="btn_left">
	    <input value="<tpl> $langLinkSubmit </tpl>" type="submit" class="btn_submit"/></span></div></div>
</form>

<script>
$(document).ready(function() {
	
	var options = {
		beforeSubmit:  function(){showLoading(showSaveText);},
		success:       function(msg){
							hideLoading();
							showMessage(msg.message,msg.type);
							if(msg.type == '1'){
								ST(0,0);
								ShowDiv = "result_content";
								getPageContent("link.manage.php?action=ajax_list");
							}
						},
		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);
		}
	});
	
	//生成静态
	$('#make_html').click(function(){
		$.ajax({
			url: "html.manage.php",
			data: "action=link",
			type:'post',
			dataType:"json",
			beforeSubmit:  showLoading(showText),
			success: function(msg){
				hideLoading();
				showMessage(msg.message,msg.type);
			}
		});
		return false;
	});
});
</script>