// JavaScript Document
	function Trim(str){
	 if(str.charAt(0) == " "){
	  str = str.slice(1);
	  str = Trim(str); 
	 }
	 return str;
	}
	
	function form_check(obj,str)
	{
		if(Trim(obj.value)=="")
		{
			alert(str);
			obj.focus();
			return false;
		}else{
			return true;
		}
	}
	function form_length_check(obj,str,lens)
	{
		if(obj.value.length<lens)
		{
			alert(str);
			obj.focus();
			return false;
		}
		else
		{
			return true;
		}
	}
	function admin_login_checkSubmit(){
		if(!form_check(document.form1.user,"\n用户名不能为空!")) return false;
		if(!form_check(document.form1.adminPSW,"\n密码不能为空!")) return false;
	}	
	
	function Edit_admin_User_Form()
	{
		if(!form_check(document.form1.adminUserName,"\n用户名不能为空!")) return false;
		if(Trim(document.form1.adminUserPSW.value)=="" || Trim(document.form1.adminUserPSW1.value)=="" || (Trim(document.form1.adminUserPSW.value)!=Trim(document.form1.adminUserPSW1.value)))
		{
			alert("密码为空或二次输入密码不相符！");
			document.form1.adminUserPSW.value="";
			document.form1.adminUserPSW1.value="";
			document.form1.adminUserPSW.focus();
			return false;
		}
	}
	
	function Edit_Content_Form()
	{
		if(!form_check(document.form1.Channel1ID,"\n请选择一级栏目!")) return false;
		if(!form_check(document.form1.Channel2ID,"\n请选择二级栏目!")) return false;
		if(!form_check(document.form1.title,"\n请填写标题!")) return false;
	}
	
	function Channel()
	{
		if(!form_check(document.form1.channelName,"\n栏目名称不能为空!")) return false;
	}
	
	function SetType(val)
	{
		ss = val.split("|");
		if(ss[1]=="1")
		{
			//上传文件
			document.all.File.style.display = "";
			document.all.News.style.display = "none";
		}
		else if(ss[1]=="0")
		{
			//上传内容
			document.all.File.style.display = "none";
			document.all.News.style.display = "";
		}
	}
	
	
	function SelectedSet(obj,value)
	{
		for(var i=0;i<obj.length;i++)
		{
			if(obj[i].value == value)
				obj[i].selected = true;
			else
				obj[i].selected = false;
		}	
	}
	
	function RadioSet(obj,value)
	{
		for(var i=0;i<obj.length;i++)
		{
			if(obj[i].value == value)
				obj[i].checked = true;
			else
				obj[i].checked = false;
		}	
	}

	function link_submit()
	{
		if(!form_check(document.link.LinkName,"\n请填写名称!")) return false;
		if(!form_check(document.link.LinkUrl,"\n请填写链接地址!")) return false;
	}
	
	function admin_change_Submit()
	{
		if(Trim(document.form1.adminUserPSW.value)=="" || Trim(document.form1.adminUserPSW1.value)=="" || (Trim(document.form1.adminUserPSW.value)!=Trim(document.form1.adminUserPSW1.value)))
		{
			alert("密码为空或二次输入密码不相符！");
			document.form1.adminUserPSW.value="";
			document.form1.adminUserPSW1.value="";
			document.form1.adminUserPSW.focus();
			return false;
		}
	}
	
	function faq()
	{
		if(!document.faqForm.anonymity.checked)
		{
			if(!form_check(document.faqForm.UserName,"\n请填写您的姓名或选择匿名留言!")) return false;
		}
		if(!form_check(document.faqForm.title,"\n请填写标题!")) return false;
		if(!form_check(document.faqForm.content,"\n请填写内容!")) return false;
	}
	
	function edit_faq()
	{
		if(!form_check(document.faqForm.title,"\n请填写标题!")) return false;
		if(!form_check(document.faqForm.content,"\n请填写内容!")) return false;
	}
	
	function pop_submit()
	{
		if(!form_check(document.pop.title,"\n请填写标题!")) return false;
		if(!form_check(document.pop.content,"\n请填写内容!")) return false;
	}
	
	function changeAdType(val)
	{
		if(val == "1")
		{
			document.ad.AdWidth.value = "470";
			document.ad.AdHeight.value = "60";
		}
		else if(val == "2")
		{
			document.ad.AdWidth.value = "194";
			document.ad.AdHeight.value = "52";
		}
		else if(val == "3")
		{
			document.ad.AdWidth.value = "370";
			document.ad.AdHeight.value = "50";
		}
		else if(val == "4")
		{
			document.ad.AdWidth.value = "182";
			document.ad.AdHeight.value = "50";
		}
	}
	
	function CheckEditLevel()
	{
		if(!form_check(document.userlevel.userlevelName,"\n请填写会员级别名称!")) return false;
	}
	function checkReggongsi(act)
	{
		if(act == "insert")
		{
			if(!form_check(document.reg.Username,"\n请填用户名!")) return false;
		}
		if(Trim(document.reg.password.value)=="" || Trim(document.reg.password1.value)=="" || (Trim(document.reg.password.value)!=Trim(document.reg.password1.value)))
		{
			alert("密码为空或二次输入密码不相符！");
			document.reg.password.value="";
			document.reg.password1.value="";
			document.reg.password.focus();
			return false;
		}
		
		if(!form_check(document.reg.D_Company,"\n请填写公司名称!")) return false;
		if(!form_check(document.reg.D_Contact,"\n填息联系人姓名!")) return false;
		if(!form_check(document.reg.Tel,"\n请输入联系电话!")) return false;
		if(!check_email(document.reg.Mail.value))
		{
			alert("请输入一个正确的邮件地址！");
			document.reg.Mail.focus();
			return false;
		}
		if(!form_length_check(document.reg.memo,"\n公司简介不得少于30字!",30)) return false;
	}
	function chckRegSubmit(act)
	{
		if(act == "addjob")
		{
			if(!form_check(document.reg.JobKind,"\n请选择招聘种类!")) return false;
			if(!form_check(document.reg.Channel1ID,"\n请选择职业分类!")) return false;
			if(!form_check(document.reg.Channel2ID,"\n请选择职业!")) return false;
			if(!form_check(document.reg.DetailJob,"\n请填写详细招聘职位!")) return false;
			if(!form_check(document.reg.Speciality,"\n请选择专业要求分类!")) return false;
			if(!form_check(document.reg.DetailSpeciality,"\n请填写详细专业要求!")) return false;
			if(!form_check(document.reg.Degree,"\n请选择最低学历要求!")) return false;
			if(!form_check(document.reg.Sex,"\n请选择性别要求!")) return false;
			if(!form_check(document.reg.AgeRequer,"\n请选择年龄要求!")) return false;
			if(!form_check(document.reg.WorkTime,"\n请选择工作年限!")) return false;
			if(!form_check(document.reg.Salary,"\n请选择工资水平!")) return false;
			if(!form_check(document.reg.TimeLimit,"\n请选择招聘期限!")) return false;
			if(!form_check(document.reg.HouseProvince,"\n请选择工作地点!")) return false;
			if(!form_check(document.reg.Housearea,"\n请填写地区!")) return false;
			if(!form_check(document.reg.JobNumber,"\n请填写招聘人数!")) return false;
			
			if(!checknum(document.reg.JobNumber.value)) 
			{
				alert("招聘人数为数字！");
				document.reg.JobNumber.focus();
				return false;
			}
			if(!form_length_check(document.reg.memo,"\n具体要求不得少于30字!",30)) return false;
		}
		if(act == "insert")
		{
			if(!form_check(document.reg.Username,"\n请填用户名!")) return false;
		}
		if(Trim(document.reg.password.value)=="" || Trim(document.reg.password1.value)=="" || (Trim(document.reg.password.value)!=Trim(document.reg.password1.value)))
		{
			alert("密码为空或二次输入密码不相符！");
			document.reg.password.value="";
			document.reg.password1.value="";
			document.reg.password.focus();
			return false;
		}
		
		if(!form_check(document.reg.birthday,"\n请填写出生年份!")) return false;
		if(!form_check(document.reg.Housearea,"\n请填写户口所在地区!")) return false;
		if(!form_check(document.reg.earea,"\n请填写居住地区!")) return false;
		if(!form_check(document.reg.Tel,"\n填息联系电话!")) return false;
		if(!form_check(document.reg.Tel,"\n请输入联系电话!")) return false;
		if(!check_email(document.reg.Mail.value))
		{
			alert("请输入一个正确的邮件地址！");
			document.reg.Mail.focus();
			return false;
		}
		if(!form_check(document.reg.DetailSpeciality,"\n请填写详细专业!")) return false;
		if(!form_check(document.reg.School,"\n请填写毕业院校!")) return false;
		if(!form_check(document.reg.Channel1ID,"\n请选择职业分类!")) return false;
		if(!form_check(document.reg.Channel2ID,"\n请选择职业!")) return false;
		if(!form_check(document.reg.Channel1ID2,"\n请选择职业分类二!")) return false;
		if(!form_check(document.reg.Channel2ID2,"\n请选择职位！")) return false;
		if(!form_check(document.reg.jobtypedetail,"\n请输入详细应聘职位!")) return false;
		if(!form_length_check(document.reg.memo,"\n简历不得少于30字!",30)) return false;
		/*if(!(Trim(document.reg.IDCard.value).length==15 || Trim(document.reg.IDCard.value).length==18))
		{
			alert("身份证号必须是15位或18位！");
			document.reg.IDCard.focus();
			return false;
		}*/
	}
	function checknum(obj){
		if (isNaN(obj)){
			    return false;
			}
		return true;
	}

	function check_email(address) {
 					if ((address == "")
				    || (address.indexOf ('@') == -1)
				    || (address.indexOf ('.') == -1))
				      return false;
					  return true;	
    }
	
	function CheckRegUser(loadpos)
	{
		 newWindow = window.open(loadpos,"inv","dependent,width=300,height=200");
		 newWindow.focus();
	}
	
	function club()
	{
		if(!form_check(document.clubForm.Title,"\n请输入标题!")) return false;
	}
	
	function edit_msg()
	{
		if(!form_check(document.form1.msgtypeID,"\n请选择认证分类!")) return false;
		if(!form_check(document.form1.tit,"\n请输入认证企业名称!")) return false;
		if(!form_check(document.form1.msg,"\n请输入认证范围!")) return false;
		if(!form_check(document.form1.kin,"\n请选择认证三体系!")) return false;
		if(!form_check(document.form1.tim,"\n请输入发证日期!")) return false;
		if(!form_check(document.form1.edt,"\n请输入edt!")) return false;
		if(!form_check(document.form1.mal,"\n请输入证书编号!")) return false;
	}
    
	function onlinesubmit()
	{
		if(!form_check(document.submitForm.kin,"\n请选择认证体系!")) return false;
		if(!form_check(document.submitForm.msgtypeID,"\n请选择认证类别!")) return false;
		if(!form_check(document.submitForm.company,"\n请输入公司名称!")) return false;
		if(!form_check(document.submitForm.person,"\n请输入联系人!")) return false;
		if(!form_check(document.submitForm.Tel,"\n请输入联系电话!")) return false;
		if(!check_email(document.submitForm.Mail.value))
		{
			alert("请输入一个正确的邮件地址！");
			document.submitForm.Mail.focus();
			return false;
		}
	}
	function InitAjax()
	{
	　var ajax=false; 
	　try { 
	　　ajax = new ActiveXObject("Msxml2.XMLHTTP"); 
	　} catch (e) { 
	　　try { 
	　　　ajax = new ActiveXObject("Microsoft.XMLHTTP"); 
	　　} catch (E) { 
	　　　ajax = false; 
	　　} 
	　}
	　if (!ajax && typeof XMLHttpRequest!='undefined') { 
	　　ajax = new XMLHttpRequest(); 
	　} 
	　return ajax;
	}
	
	function CheckAll(objname)
	{
		var e = document.all[objname];
		if(e.length==undefined)
		{
			if(e.checked)
				e.checked = false;
			else
				e.checked = true;
		}
		else
		{
			for (var i=0;i<e.length;++i){
				if(e.item(i).checked)
					e.item(i).checked = false;
				else
					e.item(i).checked = true;
			}
		}
	}

	function batchAct(act) {
	//批量操作
		var strTitle;
		strTitle="";
		if(act=="batchDel" ){
			strTitle="您确定要批量删除吗？";
		}
			
		if(confirm(strTitle)){
			window.list.action="?act=" + act;
			window.list.method="post";
			window.list.submit();
			return;
		}else{
			return false;
		}
	}
