// JavaScript Document
function Show(j){
	var Ar_obj=new Array("IdHanye","IDarea");//所有对象名称
	var Ar_obj_link_td=new Array("DivTd0","DivTd1");//所关联的显示层
	
	var SelectedOK_cls="CLS_0_1" //选中样式名称
	var SelectedNo_cls="CLS_0_0";//普通样式名称
	
	var Gur_i=parseInt(j);
	
	var LastUpdateData=Gur_Selected.value;//设置上一次的对象值
	
	if(parseInt(LastUpdateData) == Gur_i){
		return ;
	}
	
	var obj_str=""+Ar_obj[j];
	var Obj=strToObject(obj_str)
	if(ObjectIsAVI(Obj)){ //检查控件存在
	   
	   eval(Ar_obj[j]+".className='"+SelectedOK_cls+"'");//当前选中的改变样式
	   eval(Ar_obj[LastUpdateData]+".className='"+SelectedNo_cls+"'");//上一次的改变样式
	   
	   eval(Ar_obj_link_td[j]+".style.display=''")//改变样式 className
	   eval(Ar_obj_link_td[LastUpdateData]+".style.display='none'")//改变样式 className
	   
	   Gur_Selected.value=j	   
	}
}

function ShowHye(j){//Hye_All_OBJ
	
	var SelectedOK_cls="Hye1" //选中样式名称
	var SelectedNo_cls="Hye0";//普通样式名称
	
	var Gur_i=parseInt(j);//对象名称 IDhead
	
	var LastUpdateData=Gur_Selected.value;//设置上一次的对象值

	if(parseInt(LastUpdateData) == Gur_i){
		return ;
	}
	
	var obj_str="IDhead"+j;
	var Obj=strToObject(obj_str)
	if(ObjectIsAVI(Obj)){ //检查控件存在
	   
	   eval("IDhead"+j+".className='"+SelectedOK_cls+"'");//当前选中的改变样式
	   if((""+LastUpdateData) != "-1"){
	   eval("IDhead"+LastUpdateData+".className='"+SelectedNo_cls+"'");//上一次的改变样式
	   eval("DIVhye"+LastUpdateData+".style.display='none'")//改变样式 className
	   }   
	   
	   eval("DIVhye"+j+".style.display=''")//改变样式 className
	   
	   Gur_Selected.value=j	   
	}

}
//---------必变国家后的动作
function ChangeCountry_Over(value){
	var value=""+value
	if(value == "0"){
		setSelectNull(document.PeiTaoProducts.Sprovince)
		setSelectNull(document.PeiTaoProducts.Scity)
	}else{
		var ProvincesData=GetDataSourceCountry(Ar_country,value);
		var a=InitProvince(document.PeiTaoProducts.Sprovince,ProvincesData,"",document.PeiTaoProducts.Scountry)
        InitCity(document.PeiTaoProducts.Scity,a,"",document.PeiTaoProducts.Sprovince);

		AppendPLSselect(document.PeiTaoProducts.Sprovince,"所有省份");
		AppendPLSselect(document.PeiTaoProducts.Scity,"所有城市");
	}
}
function AppendPLSselect(Form,txt){
   selectAdd(Form,txt,"0","0")
}
function InitArea0(ve){
   var ve=""+ve
   if(ve == "" || ve=="undefined"){ve=""}
   var DataSource=InitCountry(document.PeiTaoProducts.Scountry,Ar_country,ve)
   //var a=InitProvince(document.PeiTaoProducts.Sprovince,DataSource,"",document.PeiTaoProducts.Scountry)
   //InitCity(document.PeiTaoProducts.Scity,a,"",document.PeiTaoProducts.Sprovince)
   
   AppendPLSselect(document.PeiTaoProducts.Scountry,"请选择工作区域");
   AppendPLSselect(document.PeiTaoProducts.Sprovince,"请选择省份");
   AppendPLSselect(document.PeiTaoProducts.Scity,"请选择城市");
}
function Init_First_AllArea(Area_2){
	var Area_2=""+Area_2
	if(!IsNull(Area_2)){
		var country="",province="",city="";
		if(Area_2.length>=2){
			country=""+Area_2.substring(0,2)
			if(country == "86"){
				country="086";
				Area_2="0"+Area_2;
			}else{
				country=""+Area_2.substring(0,3)
			}
		}
		
		if(Area_2.length >=5){
			province=Area_2.substring(3,5)
		}
		if(Area_2.length >=7){
			city=Area_2.substring(5,7)
		}

        var DataSource=InitCountry(document.PeiTaoProducts.Scountry,Ar_country,country)

		if(country.length<2 || country=="00"){
			AppendPLSselect(document.PeiTaoProducts.Scountry,"请选择工作区域");
			AppendPLSselect(document.PeiTaoProducts.Sprovince,"请选择省份");
			AppendPLSselect(document.PeiTaoProducts.Scity,"请选择城市");
		}else{
			var a=InitProvince(document.PeiTaoProducts.Sprovince,DataSource,province,document.PeiTaoProducts.Scountry)
			if(province.length<2 || province=="00"){
				AppendPLSselect(document.PeiTaoProducts.Sprovince,"请选择省份");
				AppendPLSselect(document.PeiTaoProducts.Scity,"请选择城市");
			}else{
				InitCity(document.PeiTaoProducts.Scity,a,city,document.PeiTaoProducts.Sprovince);
				if(city.length<2 || city =="00"){AppendPLSselect(document.PeiTaoProducts.Scity,"请选择城市");}
			}
		}
		
	}
}

function InitJob(){
   var JobIDS="";
   InitJob_base("")
   /*
   var Ar_JobIDS=JobIDS.split(",");
   
   var h1_1="",h1_2="";
   
   if(Ar_JobIDS.length>0){//Ar_JobIDS
      var h1_all_string=Ar_JobIDS[0]
      h1_1=""+h1_all_string.substring(0,2);
	  h1_2=""+h1_all_string.substring(2,4);
   }
   var a=InitHyeid(document.PeiTaoProducts.Hye_ID1_1,Cs_Config_JobClass,h1_1,"Code")
   InitHyeid2(document.PeiTaoProducts.Hye_ID1_2,a,h1_2,"Code")
   if(IsNull(h1_1) || ""+h1_1=="00"){
      AppendPLSselect(document.PeiTaoProducts.Hye_ID1_1,"请选择工种");
	  AppendPLSselect(document.PeiTaoProducts.Hye_ID1_2,"请选择工种")      
   }   
   */
}
function InitJob2(value){
	var ve=""+value,Hye_1="0",Hye_2="0";
	if(ve.length >2){
		Hye_1=ve.substring(0,2)
		Hye_2=ve.substring(2,ve.length)
		ve=ve.substring(0,2)+","+ve.substring(2,ve.length)
		Ar_ve=ve.split(",");
	}
	InitJob_base(ve)
	if(IsNull(Hye_1)){
		Hye_1="0"
	}
	if(IsNull(Hye_2)){
		Hye_2="0"
	}
    AppendPLSselect(document.PeiTaoProducts.Hye_ID1_1,"请选择工种");
    AppendPLSselect(document.PeiTaoProducts.Hye_ID1_2,"请选择工种"); 
	setSelectIndex(document.PeiTaoProducts.Hye_ID1_1,Hye_1)
	setSelectIndex(document.PeiTaoProducts.Hye_ID1_2,Hye_2)
}
function InitJob_base(value){
   var JobIDS=value;
   var Ar_JobIDS=JobIDS.split(",");
   
   var h1_1="",h1_2="";
   
   if(Ar_JobIDS.length>0){//Ar_JobIDS
      h1_1=""+Ar_JobIDS[0];
   }
   if(Ar_JobIDS.length>=1){//Ar_JobIDS
      h1_2=""+Ar_JobIDS[1];
   }
   var a=InitHyeid(document.PeiTaoProducts.Hye_ID1_1,Cs_Config_JobClass,h1_1,"Code")
   InitHyeid2(document.PeiTaoProducts.Hye_ID1_2,a,h1_2,"Code")
   if(IsNull(h1_1) || ""+h1_1=="00"){
      AppendPLSselect(document.PeiTaoProducts.Hye_ID1_1,"请选择工种");
	  AppendPLSselect(document.PeiTaoProducts.Hye_ID1_2,"请选择工种")      
   }   
}
