<table width="100%" class="topmenu">
	<tr><td>
		<a href="index.php?catid={?$catid?}"><em>栏目内容</em></a><span>|</span>
		<a href="post.php?catid={?$catid?}" class="on"><em>添加招聘</em></a><span>|</span>
		<a href="{?$saxue_admin_url?}/move.php?catid={?$catid?}"><em>批量移动</em></a>
	</td></tr>
</table>
<form id="formAdd" method="post">
<input type="hidden" name="dosubmit" value="1">
<input type="hidden" name="catid" value="{?$catid?}">
{?if $row.id>0?}<input type="hidden" name="id" value="{?$row.id?}">{?/if?}
<table width="100%" class="grid">
	<tr>
		<td class="tdleft" width="80">语言：</td>
		<td>
			<select name="lang" id="lang">
				<option value="">选择语言</option>{?section name=i loop=$lang?}<option value="{?$i['key']?}"{?if $i['key']==$row.lang?} selected{?/if?}>{?$lang[i].name?}</option>{?/section?}
			</select>
		</td>
	</tr>
	<tr>
		<td class="tdleft">招聘职位：</td>
		<td>
			<input name="title" id="title" type="text" value="{?$row.title?}" size="80" class="text" maxlength="30" />&nbsp;
			<label><input type="checkbox" name="islink" id="islink" value="1" onclick="setlinkurl();"{?if 1==$row.islink?} checked{?/if?} /><span class="red">转向链接</span><label>
		</td>
	</tr>
	<tr id="linkshow"{?if 0==$row.islink?} style="display:none"{?/if?}>
		<td class="tdleft">转向链接：</td>
		<td><input name="linkurl" id="linkurl" type="text" value="{?if 1==$row.islink?}{?$row.url?}{?/if?}" size="80" class="text" /></td>
	</tr>
	<tr>
		<td class="tdleft">招聘人数：</td>
		<td><input name="count" id="count" type="text" value="{?$row.count?}" size="80" maxlength="4" class="text" onkeyup="value=value.replace(/[^0-9]/g,'');" /> 0或留空不限</td>
	</tr>
	<tr>
		<td class="tdleft">工作地点：</td>
		<td><input name="place" id="place" type="text" value="{?$row.place?}" size="80" class="text" maxlength="20" /></td>
	</tr>
	<tr>
		<td class="tdleft">工资待遇：</td>
		<td><input name="deal" id="deal" type="text" value="{?$row.deal?}" size="80" class="text" maxlength="20" /></td>
	</tr>
	<tr>
		<td class="tdleft">有效天数：</td>
		<td><input name="lifedays" id="lifedays" type="text" value="{?$row.lifedays?}" size="80" maxlength="4" class="text" onkeyup="value=value.replace(/[^0-9]/g,'');" /> 0或留空不限</td>
	</tr>
	<tr>
		<td class="tdleft">内容：</td>
		<td>{?function saxue_geteditor:'content':680:380:'':1:array('Flash','Media')?}<textarea name="content" id="content">{?$row.content?}</textarea></td>
	</tr>
	<tr>
		<td class="tdleft">内容选项：</td>
		<td>
			<label><input name="auto_remote" type="checkbox" value="1" checked />下载非本站图片到本地</label>&nbsp;
			<label><input name="auto_link" type="checkbox" value="1" checked />清除非本站链接</label>&nbsp;
		</td>
	</tr>
	<tr>
		<td class="tdleft">状态：</td>
		<td>
			<label><input name="display" type="checkbox" value="1"{?if '1'==$row.display || ''==$row.display?} checked{?/if?} />发布<label>&nbsp;
			<label><input name="istop" type="checkbox" value="1"{?if '1'==$row.istop?} checked{?/if?} />置顶<label>
		</td>
	</tr>
	<tr>
		<td class="tdleft"></td>
		<td><input type="submit" name="submit" id="submit" class="button" value="提 交"/></td>
	</tr>
</table>
</form>
<br><br>
<script type="text/javascript">
function setlinkurl() {
	if($('#islink').attr('checked')) {
		$('#linkshow').show(); 
	} else {
		$('#linkshow').hide(); 
	}
}
$(function(){
	$("#formAdd").ajaxForm({
		beforeSubmit : function(){
			if ($("#lang").val()=='') {
				doTip('请选择语言');
				$("#lang").focus();
				return false;
			} 
			if ($("#title").val()=='') {
				doTip('请输入招聘职位');
				$("#title").focus();
				return false;
			} 
			if ($("#place").val()=='') {
				doTip('请输入工作地点');
				$("#place").focus();
				return false;
			} 
			if ($("#deal").val()=='') {
				doTip('请输入工资待遇');
				$("#deal").focus();
				return false;
			} 
			if($('#islink').attr('checked')) {
				if ($("#linkurl").val()=='') {
					doTip('请输入转向链接');
					$("#linkurl").focus();
					return false;
				} 
			} else if(e_content.isEmpty()) {
				doTip('内容不能为空');
				return false;
			}
		},
        dataType: "json",
        success : function(data){
			if(data.flag == 0){
				doTip(data.msg);
			}else{
				doTip('内容保存成功');
				window.top.mainframe.location.href='index.php?catid={?$catid?}';
				doDialogClose();
			}
        }
    });
})
</script>