﻿// JavaScript Document
//站内搜索
function procheck(){
	if(document.formSear.keys.value==""){
		alert("请输入关键词！");
		document.formSear.keys.focus();
		return false
	}
}

//搜索
function scheck(){
	if(document.siteSear.sid.value==""){
		alert("请选择类别！");
		document.siteSear.sid.focus();
		return false
	}
	if(document.siteSear.keys.value==""){
		alert("输入产品关键词！");
		document.siteSear.keys.focus();
		return false
	}
}

//产品列表
function remarks(object,proclass){
   if(document.getElementById(object).style.display=="block")
   {
	  proclass.className="nav_b";
      document.getElementById(object).style.display="none";
   }else{
	  proclass.className="nav_bA";
      document.getElementById(object).style.display="block";
  }
}

//首页新闻
var prev;
function newCon(obj){
	//隐藏前一个
	if(prev!=null){
		document.getElementById("con"+prev).style.display="none";
		document.getElementById("m"+prev).className="new_nav";
	}
	
	//显示这一个
	document.getElementById("con"+obj).style.display="block";
	document.getElementById("m"+obj).className="new_navA";
	
	prev=obj;
}

 //产品标签
var prevPro;
function showCon(objPro){
	//隐藏前一个
	if(prevPro!=null){
		document.getElementById("con"+prevPro).style.display="none";
		document.getElementById("m"+prevPro).className="pa";
	}
	
	//显示这一个
	document.getElementById("con"+objPro).style.display="block";
	document.getElementById("m"+objPro).className="paA";
	
	prevPro=objPro;
}

//弹出窗口
function Win(file,w,h,r,s){
    window.open(file,'','resizable='+r+',width='+w+",height="+h+',scrollbars='+s+',left='+(screen.availWidth-w)/2+',top='+(screen.availHeight-h)/2);
}

//自荐S
 function Scheck(){
	if(document.formSelf.E_1.value==""){
      alert("请输入您的姓名！");
	  document.formSelf.E_1.focus();
	  return false;
	  }
	if(document.formSelf.E_3.value==""){
      alert("年龄不能为空！");
	  document.formSelf.E_3.focus();
	  return false;
	  }
   if(document.formSelf.E_4.value==""){
      alert("请输入您的出生年月！");
	  document.formSelf.E_4.focus();
	  return false;
	  }
	if(document.formSelf.E_7.value==""){
      alert("请填写您的身份证号！");
	  document.formSelf.E_7.focus();
	  return false;
	  }
	if(document.formSelf.E_8.value==""){
      alert("您的籍贯所在地！");
	  document.formSelf.E_8.focus();
	  return false;
	  }
	if(document.formSelf.E_9.value==""){
      alert("输入您的学历！");
	  document.formSelf.E_9.focus();
	  return false;
	  }
	if(document.formSelf.E_11.value==""){
      alert("您所学的专业！");
	  document.formSelf.E_11.focus();
	  return false;
	  }
	if(document.formSelf.E_12.value==""){
      alert("你的毕业时间！");
	  document.formSelf.E_12.focus();
	  return false;
	  }
	 if(document.formSelf.E_18.value==""){
      alert("您的工龄有多久！");
	  document.formSelf.E_18.focus();
	  return false;
	  } 
	 if(document.formSelf.E_19.value==""){
      alert("您现在要应聘岗位是什么！");
	  document.formSelf.E_19.focus();
	  return false;
	  } 
	if(document.formSelf.E_21.value==""){
      alert("请留下您的联系电话！");
	  document.formSelf.E_21.focus();
	  return false;
	  } 
    if(document.formSelf.E_23.value==""){
      alert("请填写您的E-mail！");
	  document.formSelf.E_23.focus();
	  return false;
	  }
    if(emailcheck(document.formSelf.E_23.value)){
		alert("请输入正确的E-mail！");
		document.formSelf.E_23.focus();
		return false;
   }
	if(document.formSelf.validatecode.value==""){
      alert("验证码不能为空！");
	  document.formSelf.validatecode.focus();
	  return false;
	  }
}


//留言F
 function Fcheck(){
	if(document.formF.title.value==""){
      alert("主题不能为空！");
	  document.formF.title.focus();
	  return false;
	  }
   if(document.formF.man.value==""){
      alert("请正确填写您的姓名！");
	  document.formF.man.focus();
	  return false;
	  }
	if(document.formF.tel.value==""){
      alert("请填写您的联系电话！");
	  document.formF.tel.focus();
	  return false;
	  }
    if(document.formF.email.value==""){
      alert("请填写您的E-mail！");
	  document.formF.email.focus();
	  return false;
	  }
    if(emailcheck(document.formF.email.value)){
		alert("请输入正确的E-mail！");
		document.formF.email.focus();
		return false;
   }
	if(document.formF.content.value==""){
      alert("您的留言内容不能为容！");
	  document.formF.content.focus();
	  return false;
	  }
	if(document.formF.validatecode.value==""){
      alert("验证码不能为空！");
	  document.formF.validatecode.focus();
	  return false;
	  }
}

//判断Email的正确性
function   emailcheck(string){     
  var   str_len   =   string.length;   
  if   (str_len<=5){   
        return   true   
          }       
  for(i=0;i<str_len;i++){   
          if   (string.charCodeAt(i)>127){   
  return   true     
  }   
  }   
  if   (string.indexOf("@")<2){   
          return   true   
          }       
    if   (string.indexOf(".")==1){   
          return   true   
          }       
  if   (string.indexOf(":")!=-1){   
          return   true   
  }   
 }
