<form action="mailcontent.manage.php" method="post" id="form_addmailcontent">
<input type="hidden" name="action" id="action" value="addsave" />
<input type="hidden" name="txtContent" id="txtContent" />
<table border="0" cellpadding="0" cellspacing="0" class="from_table">
	<tr>
	  <th width="200" align="center"><tpl> $lanagMailType </tpl></th>
	  <td align="left" class="td rowform"><input name="txtMailGenre" type="text" class="txtinput " id="txtMailGenre" maxlength="40" /></td>
	  <td width="40%" align="left" class="vtop tips2"><label style="display:none" for="txtMailGenre" class="wrong" metaDone="true" generated="true"></label><tpl> $lanagMailTypeTemplateUseEnglish </tpl></td>
	</tr>
	<tr>
	  <th width="200" align="center"><tpl> $lanagMailTitle </tpl></th>
	  <td align="left" class="td rowform"><input name="txtMailTitle" type="text"class="txtinput " id="txtMailTitle" maxlength="40" /></td>
	  <td width="40%" align="left" class="vtop tips2"><label style="display:none" for="txtMailTitle" class="wrong" metaDone="true" generated="true"></label><tpl> $lanagMailSendTitleInset </tpl></td>
	</tr>
	<tr>
	  <th width="200" align="center"><tpl> $lanagMailExplain </tpl></th>
	  <td align="left" class="td rowform"><textarea name="txtMaildesc" id="txtMaildesc" cols="50" rows="5" class="tarea"></textarea></td>
	  <td width="40%" align="left" class="vtop tips2"><label style="display:none" for="txtMaildesc" class="wrong" metaDone="true" generated="true"></label><tpl> $lanagMailFalseCodeNeedTechnicTogether </tpl></td>
	</tr>
	<tr>
	  <th width="200" align="center"><tpl> $lanagMailContent </tpl></th>
		<td colspan="2" align="left" class="td rowform">
			<tpl>php</tpl>
			include("../classes/resource/fckeditor/fckeditor.php") ;
			$oFCKeditor = new FCKeditor('content') ;
			$oFCKeditor->BasePath	= '../classes/resource/fckeditor/' ;
			$oFCKeditor->ToolbarSet = 'Simple';
			$oFCKeditor->Width	= 385 ;
			$oFCKeditor->Height	= 220 ;
			$oFCKeditor->Value		= '';
			$oFCKeditor->Create() ;
			<tpl>/php</tpl>
			<label style="display:none" for="txtMaildesc" class="wrong" metaDone="true" generated="true"></label><br />
			<tpl> $lanagMailSendContentInseImageInfo </tpl>	  </td>
	</tr>

  </table>
  <div class="table-5-bottom">
  <div class="btn_marginleft_1">

  <span class="btn_left">
			<input type="submit" name="Submit" value="<tpl> $lanagMailSubmit </tpl>" class="btn_submit"/> 
		  </span>
		  <span class="btn_left">
			 <input id="butt_listmail" class="btn_submit" type="button" value="<tpl> $lanagMailReturnList </tpl>" />
		  </span>
		  </div>
		  </div>
</form>

<script language="javascript" type="text/javascript">
$(document).ready(function() {
	$("#butt_listmail").click(function(){
		ShowDiv = "result_content";
		getPageContent("mailcontent.manage.php?action=ajaxlist");
		ST(0,0);
	});
	//对添加表单做的验证定义
	$("#form_addmailcontent").validate({
		errorClass: "wrong",
		rules: {
			txtMailGenre: {required:true},
			txtMailTitle: {required:true}
		},
		messages: {
			txtMailGenre: {required: "<tpl> $lanagMailFillInTemplateType </tpl>"},
			txtMailTitle: {required: "<tpl> $lanagMailPleaseFillInTemplateTitle </tpl>"}
		},
		submitHandler:ajax_add
	});
});

function ajax_add(){
	//将FCK值写入隐藏域
	var oEditor = FCKeditorAPI.GetInstance('content');
	$('#txtContent').val(oEditor.GetXHTML(true));
	
	/* 取表单参数 */var queryString=$("#form_addmailcontent").formSerialize();
	$.ajax({
		url: "mailcontent.manage.php",
		data: queryString,
		type:'post',
		dataType:"json",
		beforeSubmit:  showLoading(showSaveText),
		success: function(msg){
				hideLoading();
				showMessage(msg.message,msg.type);
				if(msg.type == '1'){
					ShowDiv	= 'result_content';
					getPageContent("mailcontent.manage.php?action=ajaxlist");
				}
		}
	});
	return false;
}
</script>