//信息反馈
function checkinfo(){
  
	if(form1.truename.value==""){
	    alert("请输入您的姓名!");
	    form1.truename.focus();
	    form1.truename.style.backgroundColor = "#fffff0";
	    return false;   
	}   
	if (form1.Email.value != ""){
			if (form1.Email.value.indexOf('@') == -1 || form1.Email.value.indexOf('.') == -1) {
					alert("对不起，您的EMAIL地址写错了。");
					form1.Email.focus();
					form1.Email.style.backgroundColor = "#fffff0";
					return false;
			}
	}
	if (form1.Content.value.length < 1){
			alert('请写上反馈内容。');
			form1.Content.focus();
			form1.Content.style.backgroundColor = "#fffff0";
			return false;
	}
	if (form1.Content.value.length > 1000){
			alert('反馈内容的字数请控制在1000字以内。');
			form1.Content.focus();
			form1.Content.style.backgroundColor = "#fffff0";
			return false;
	}

}

//搜索
function schform_onsubmit() {
		if (schform.keyword.value.length < 1){
				alert("请您输入关键字。");
				schform.keyword.focus();
				schform.keyword.style.backgroundColor = "#fffff0";
				return false;
		}
		return true;
}

//邮件
function IsEmail(str){
  var nLen;
  var nCnt1, nCnt2;
  nCnt1=0;
  nCnt2=0;
  nLen = str.length;
  for(var i=0; i<nLen; i++){
      if(str.charAt(i)==' '){
          return false;}
      if(str.charAt(i)=='\'' || str.charAt(i)=='\"'){
          return false;}
      if(str.charAt(i)=='<' || str.charAt(i)=='>' ){
          return false;}
      if(str.charAt(i)=='@'){
          nCnt1++;}
      if(str.charAt(i)=='.'){
          nCnt2++;}
  }
  if( nCnt1!=1 || nCnt2<1){
      return false;
  }
  else
      return true;
}

//应聘
function checkjob(){

 if(document.form1.title.value=="")
   {alert("请填写应聘职位!!");
   document.form1.title.focus();
   form1.title.style.backgroundColor = "#fffff0";
     return false;
    }
	if(document.form1.xinjinyaoqiu.value=="")
   {alert("请填写薪金要求!!");
   document.form1.xinjinyaoqiu.focus();
   form1.xinjinyaoqiu.style.backgroundColor = "#fffff0";
     return false;
    }
	if(document.form1.zhenshiname.value=="")
   {alert("请填写真实姓名!!");
   document.form1.zhenshiname.focus();
   form1.zhenshiname.style.backgroundColor = "#fffff0";
     return false;
    }

	if(document.form1.mingz.value=="")
   {alert("请填写民族!!");
   document.form1.mingz.focus();
   form1.mingz.style.backgroundColor = "#fffff0";
     return false;
    }
	if(document.form1.marry.value=="")
   {alert("请填写婚姻状况!!");
   document.form1.marry.focus();
   form1.marry.style.backgroundColor = "#fffff0";
     return false;
    }
	
	if(document.form1.hukou.value=="")
   {alert("请填写户口所在地!!");
   document.form1.hukou.focus();
   form1.hukou.style.backgroundColor = "#fffff0";
     return false;
    }
	if(document.form1.address.value=="")
   {alert("请填写现居住地!!");
   document.form1.address.focus();
   form1.address.style.backgroundColor = "#fffff0";
     return false;
    }
	if(document.form1.xueli.value=="")
   {alert("请填写最高学历!!");
   document.form1.xueli.focus();
   form1.xueli.style.backgroundColor = "#fffff0";
     return false;
    }
	if(document.form1.biyexuexiao.value=="")
   {alert("请填写毕业学校!!");
   document.form1.biyexuexiao.focus();
   form1.biyexuexiao.style.backgroundColor = "#fffff0";
     return false;
    }
	if(document.form1.FLlevel.value=="")
   {alert("请填写外语水平!!");
   document.form1.FLlevel.focus();
   form1.FLlevel.style.backgroundColor = "#fffff0";
     return false;
	 }
	 if(document.form1.computerlevel.value=="")
   {alert("请填写计算机能力!!");
   document.form1.computerlevel.focus();
   form1.computerlevel.style.backgroundColor = "#fffff0";
     return false;
	 }		 

}

//用户登陆
function loginCheck()
{
		if (document.loginForm.loginName.value.length<1)
		{
				alert("请输入您的用户名。");
				document.loginForm.loginName.focus();
				loginForm.loginName.style.backgroundColor = "#fffff0";
				return false;
		}
		if (document.loginForm.loginPwd.value.length<1)
		{
				alert("请输入您的密码。");
				document.loginForm.loginPwd.focus();
				loginForm.loginPwd.style.backgroundColor = "#fffff0";
				return false;
		}
		return true;
}

//用户退出
function xlog()
{
		var url = location.href;
		location.href = "loginout.asp?url=" + url;
}

//新用户注册
function formPost() { //v2.0

		if (document.form1.username.value==""){
				alert("用户名不能为空!");
				document.form1.username.focus();
				form1.username.style.backgroundColor = "#fffff0";
				return false;
		}
		if (document.form1.pwd1.value == "")
		{
				alert("密码不能为空!");
				document.form1.pwd1.focus();
				form1.pwd1.style.backgroundColor = "#fffff0";
				return false;
		}
		if (document.form1.pwd1.value != document.form1.pwd2.value)
		{
				alert("两次密码输入不同!");
				document.form1.pwd2.focus();
				form1.pwd2.style.backgroundColor = "#fffff0";
				return false;
		}
		if (document.form1.realname.value == "")
		{
				alert("真实姓名不能为空!");
				document.form1.realname.focus();
				form1.realname.style.backgroundColor = "#fffff0";
				return false;
		}
		if (document.form1.tel.value!="")
		{
				if (isNaN(document.form1.tel.value)){
						alert("电话号码必须为数字。");
						document.form1.tel.focus();
						form1.tel.style.backgroundColor = "#fffff0";
						return false;
				}
		}
		if (document.form1.email.value!="")
		{
			if ((document.form1.email.value.indexOf("@") == -1) || (document.form1.email.value.indexOf(".") == -1)){
					alert("不正确的EMAIL地址.应该包含 @ . 等字符.");
					document.form1.email.focus();
					form1.email.style.backgroundColor = "#fffff0";
					return false;
			}
		}

}

//用户名是否被占用
function NameCheck()
{
		if (document.form1.username.value == "")
		{
				alert("用户名不能为空!");
				document.form1.username.focus();
				form1.username.style.backgroundColor = "#fffff0";
				return false;
		}
		document.NameCheck.hidden_name.value = document.form1.username.value;
		//alert(document.NameCheck.hidden_name.value);
		document.NameCheck.submit();
}

function checkform2(){
  if(document.gb.subject.value==""){
      alert("请输入留言主题!");
      gb.subject.focus();
      return false;
  }
  
  if(document.gb.g_name.value==""){
      alert("请输入您的姓名!");
      gb.g_name.focus();
      return false;   
  }   
  if(document.gb.tel.value==""){
      alert("请输入电话号码!");
      gb.tel.focus();
      return false;   
  }    
  if (document.gb.content.value==""){
      alert("请输入留言内容!");
      gb.content.focus();
      return false;
      }
  else
      return true;
}
