function checkform(theform){ 
 
theform.jId.value=allSelectValue(theform.selectedJob,1);
if(theform.jId.value==""){
  alert("请先选择工作岗位！");
  theform.job.focus();
  theform.goto.value="";
  return false;
}
if(theform.searchwork0.value==""&&theform.searchwork1.value==""&&theform.searchwork2.value==""){
  alert("请输入要寻求的职位！");
  theform.searchwork0.focus();
  theform.goto.value="";
  return false;
}
theform.cid_word.value=allSelectValue(theform.selectedCity,1);
if(theform.cid_word.value==""){
  alert("请选择工作地区！");
  theform.city.focus();
  theform.goto.value="";
  return false;
}
if(theform.year.value==""&&theform.come_time[1].checked==true){
   alert("请输入到岗日期年份！");
	theform.year.focus();
    theform.goto.value="";
	return false;
  }
if(theform.year.value!=""){
  if(!isPosInteger(theform.year.value)||theform.year.value.length!=4){
    alert("到岗日期年份输入有误！");
	theform.year.focus();
    theform.goto.value="";
	return false;
  }
}

if(theform.y_WorkYear.value==""){
   alert("请输入工作经验年份！");
	theform.y_WorkYear.focus();
    theform.goto.value="";
	return false;
  }
  
if(theform.y_WorkYear.value!=""){
  if(!isPosInteger(theform.y_WorkYear.value)||theform.y_WorkYear.value.length>2){
    alert("工作经验年份输入有误！");
	theform.y_WorkYear.focus();
    theform.goto.value="";
	return false;
  }
}
  
if(theform.m_WorkYear.value!=""){
  if(!isPosInteger(theform.m_WorkYear.value)||theform.m_WorkYear.value>12){
    alert("工作经验月份输入有误,不能大于12！");
	theform.m_WorkYear.focus();
    theform.goto.value="";
	return false;
  }
}

if(theform.WorkedNumber.value!=""){
  if(!isPosInteger(theform.WorkedNumber.value)||theform.WorkedNumber.value>280){
    alert("曾工作过的企业数输入有误！");
	theform.WorkedNumber.focus();
    theform.goto.value="";
	return false;
  }
}

  if(theform.job_history.value==""){
    alert("请输入工作经历信息！");
	theform.job_history.focus();
    theform.goto.value="";
	return false;
  }	

  if(theform.job_history.value.length>3000){
    alert("工作经历字数不能超过3000！");
	theform.job_history.focus();
    theform.goto.value="";
	return false;
  }
    
theform.Stepend.disabled=true;
theform.Stepback.disabled=true;

return true;
}
function pop(){
   alert(addJob.come_time.value);
}

function check(){
  if(document.form1.name.value==""){
         window.alert("请输入姓名！");
         window.form1.name.focus();
         return false;
     }
	if(document.form1.sex[0].checked==false && document.form1.sex[1].checked==false)
		{
			alert("请选择性别！");
			document.form1.sex[0].focus();
			return false;
		}
   if(document.form1.nation[0].checked==false && document.form1.nation[1].checked==false)
		{
			alert("请输入民族！");
			document.form1.nation[0].focus();
			return false;
		}
	 if(document.form1.year.value==""){
         window.alert("请输入出生日期！");
         window.form1.year.focus();
         return false;
     }
	  
	  if(document.form1.height.value==""){
         window.alert("请输入身高！");
         window.form1.height.focus();
         return false;
     }else{
		if(!isPosInteger(form1.height.value)){
          window.alert("身高必须为数值！");
          window.form1.height.focus();
          return false;
		}
 
	 }
	 if(document.form1.marry[0].checked==false && document.form1.marry[1].checked==false&&document.form1.marry[2].checked==false&&document.form1.marry[3].checked==false)
		{
			alert("请输入婚姻状况！");
			document.form1.marry[0].focus();
			return false;
		}
  if(document.form1.school.value==""){
    alert("请输入毕业院校！");
	document.form1.school.focus();
	return false;
  }
  if(document.form1.educate.value==""){
    alert("请输入教育培训信息！");
	document.form1.educate.focus();
	return false;
  }

  if(document.form1.educate.value.length<10){
    alert("教育培训字数不得少于10！");
	document.form1.educate.focus();
	return false;
  }			
  if(document.form1.educate.value.length>1000){
    alert("教育培训字数不能超过1000！");
	document.form1.educate.focus();
	return false;
  }			
  if(document.form1.other_ablity.value==""){
    alert("请输入个人能力！");
	document.form1.other_ablity.focus();
	return false;
  }		
  if(document.form1.other_ablity.value.length<20){
    alert("个人能力字数不能少于20字！");
	document.form1.other_ablity.focus();
	return false;
  }	

  if(document.form1.other_ablity.value.length>1000){
    alert("个人能力字数不能超过1000字！");
	document.form1.other_ablity.focus();
	return false;
  }	
if(document.form1.tel.value=="" && document.form1.micro_tel.value==""){
         window.alert("请输入电话号码！");
         window.form1.tel.focus();
         return false;
     }

    var rp = document.form1.tel.value;
    if (rp.length>0 && !isPhone(rp))
    {
        alert("不是有效电话号码,请修改!(如010-85627198-128)");
        //getCheckErrInfo(1);
        document.form1.tel.focus();
        return false;
    }
	
    var mn = document.form1.micro_tel.value;
    if (mn.length>0 && !isPhone(mn))
    {
	   alert("不是有效手机号码,请修改!([0]13xxxxxxxxx)")
       // getCheckErrInfo(2);
       document.form1.micro_tel.focus();
       return false;
    }
     if(document.form1.email.value==""){
         window.alert("请输入email地址！");
         window.form1.email.focus();
         return false;
     }
	 if(document.form1.email.value.indexOf('@')==-1||document.form1.email.value.indexOf('.')==-1){
         window.alert("email地址不正确，请检查！");
         window.form1.email.focus();
         return false;
     }
	 if(document.form1.self_value.value==""){
	    window.alert("请输入自我评价！");
		document.form1.self_value.focus();
		return false;
	 }
	  if(document.form1.self_value.value.length<20){
	    alert("自我评价字数不得少于20！");
		document.form1.self_value.focus();
		return false;
	  } 
	 if(document .form1.self_value.value.length>1000){
	   window.alert("自我评价字数不能超过1000！");
		document.form1.self_value.focus();
		return false;	   
	 }
	 document.form1.Step2.disabled=true;
	 return true;
}

//检查第一外语和第二外语是否相同
function equals(){
	if (form1.language_One.value==form1.language_Two.value){
		alert("您选择了相同的第一外语和第二外语");
	}	
}

/**得到职位参数的值，返回：企业id,职位id;企业id,职位id
  theform 表单对象
  boxName 表单对象中的复选框，记录企业id和职位id，格式:企业id,职位id
*/
function getJobParam(theform,boxName){
	var strParam="";
    for(i=0;i<theform.elements.length;i++){
	  if(theform.elements[i].name==boxName&&theform.elements[i].checked==true){
         if(strParam=="") 
		   strParam=theform.elements[i].value;
		 else
		   strParam+=";"+theform.elements[i].value;
	  }
	}
	return strParam;
}

/**
  查看职位，可以多个
  theform 表单对象
  boxName 表单对象中的复选框，记录企业id和职位id，格式:企业id,职位id
*/
function viewJobs(theform,boxName){
	var strParam=getJobParam(theform,boxName);
	//strParam=escape(strParam);
	if(strParam!=""){
	  theform.action="/channel.do?handle=CompanyJobsView_jobs_Search";
	  theform.idset.value=strParam;
	  theform.submit();
	}else{
		alert("请选择要查看的职位！");  
	}	
}

/**应聘职位，可以多个
  theform 表单对象
  boxName 表单对象中的复选框，记录企业id和职位id，格式:企业id,职位id
  */
function applyJobs(theform,boxName){
	var strParam=getJobParam(theform,boxName);
	if(strParam!=""){
	  url="/person.do?handle=CompanyJobsView_apply&isReDo=1&idset="+strParam;
	  window.open(url);
	  //runScriptByPOST(url);
	  //theform.action="/channel.do?handle=CompanyJobsView_apply&isPopLogin=1";
	  //theform.idset.value=strParam;
	  //theform.submit();
	}else{
		alert("请选择要应聘的职位！");  
	}	  
}

//将职位放入收藏夹
  function putJobsInFav(theform,boxName){
	  var strParam=getJobParam(theform,boxName);
	  if(strParam!=""){
        runScriptByPOST('/person.do?handle=CompanyJobsView_favorite&isPopLogin=1&idset='+strParam); 
	  }else{
		alert("请选择要放入收藏夹的职位！");  
	  }	  
  }
