    var currentPopup=null;
	function popupDialog(evt,dialogid){
		closeCurrentDialog();
		var mX = evt.x?evt.x:evt.pageX;
		var mY = evt.y?evt.y:evt.pageY;	
		var dialog = document.getElementById(dialogid);
		dialog.style.left = (mX - parseInt(dialog.style.width) / 2 + document.documentElement.scrollLeft) + "px";		
		dialog.style.top = (mY - 15 + document.documentElement.scrollTop)+"px";
		dialog.style.display = "";
		currentPopup = dialogid;
		dialog.focus();
	}
	function select(obj,id){
		obj.selectChange(id);
	}
	function show(obj){
		var id=document.getElementById(obj.eleid).value;
		id=id?id:0;
		var pid;
		if(id==0){
			 pid=id;
		}else{
			pid=obj.arrData[id][0];
		}
		obj.fillFileds(pid);
	}
	function closeDialog(dialogid){		
		var dialog=document.getElementById(dialogid);
		dialog.style.display="none";
		currentPopup=null;
		creatMask(0);//创建遮挡层 1为创建 0为去除
	}
	function closeCurrentDialog(){	
		if(currentPopup){
			closeDialog(currentPopup);
		}
	}

	function proviceFill(proviceid,arrProvice){		
		var pele = document.getElementById(proviceid);			
		pele.length=0;
		for(var i = 0;i<arrProvice.length;i++){
			pele.options[pele.length]=new Option(arrProvice[i],arrProvice[i]);
		}  		
	}
	
	function area(){
		this.eleid=null;//用来存放分类ID的元素
		this.arrData=null;//分类数组
		this.pathid=null;//用来存放分类路径的元素		
		this.obj=null;//引用本身
		this.showid=null;//用于显示的元素
		this.mult=1;
		this.list='citylist';
	}
	area.prototype.hotfill = function(){
		document.getElementById('pcheck').innerHTML='';
		//document.getElementById('pcheck').style.display='none';

		var fileds="";
		var count=0;
		for(var i in this.arrData){			
			if(this.arrData[i][2]==1){ 	
				if(this.mult==1){
					fileds+="<div><input name=\"radioarea\" onclick=\""+this.obj+".select("+i+",this)\" type='radio' id='city"+i+"'";
				}else{
					fileds+="<div><input onclick=\""+this.obj+".select("+i+",this)\" type='checkbox' id='city"+i+"'";
				}
				var $abc=document.getElementById('citychecked');
				if($abc.childNodes.length>0){					
					for(var j=0;j<$abc.childNodes.length;j++){
						if($abc.childNodes[j].childNodes[0].value==i){
							fileds+=" checked";	
						}
					}
				}
				fileds+="><NOBR>"+this.arrData[i][1]+"</NOBR></div>";
				count++;
			}
		}				
		document.getElementById(this.list).innerHTML=fileds;	
		
		//if(count>1){
		//	document.getElementById('pcheck').style.display='';
		//	if(this.mult==1){
		//		document.getElementById('pcheck').innerHTML="<input id='city"+provice+"' name=\"radioarea\" type=\"radio\" value=\""+provice+"\" onclick=\""+this.obj+".select("+provice+",this)\"><strong>"+this.arrData[provice][1]+"</strong>(选择此大类,将包括以下小类)";
		//	}else{
		//		document.getElementById('pcheck').innerHTML="<input id='city"+provice+"' name=\"radioarea\" type=\"checkbox\" value=\""+provice+"\" onclick=\""+this.obj+".select("+provice+",this)\"><strong>"+this.arrData[provice][1]+"</strong>(选择此大类,将包括以下小类)";
		//	}
		//}

		var $abc=document.getElementById('citychecked');
		if($abc.childNodes.length>0){					
			for(var j=0;j<$abc.childNodes.length;j++){
				if($abc.childNodes[j].childNodes[0].value==provice){
					document.getElementById('city'+provice).checked=true;
					if(this.mult!=1){
						for(var i=0;i<document.getElementById('citylist').childNodes.length;i++){
							document.getElementById('citylist').childNodes[i].childNodes[0].disabled=true;
						}
					}
					break;
				}
			}
		}
	}
	area.prototype.init = function (){	
		//获取初始值
		var checklist=new Array();
		if(document.getElementById(this.eleid).value){
			var strselect=document.getElementById(this.eleid).value;
			if(strselect.indexOf(',')!=-1){
				strselect=strselect.substr(1,document.getElementById(this.eleid).value.length-2);
				checklist=strselect.split(',');
			}else{
				checklist[0]=strselect;
			}
		}else{
			checklist[0] = 0;
		}

		//填充下拉列表
		var pele = document.getElementById('provice');	
		pele.options[pele.length]=new Option('请选择',0);
		for(var i in this.arrData){
			if(this.arrData[i][0]==0){
				pele.options[pele.length]=new Option(this.arrData[i][1],i);
				if(this.arrData[i][1]==checklist[0]||i==checklist[0]){
					pele.options[pele.length-1].selected=true;
				}
			}
		}		
		//this.fillFileds(pele.value);
		this.hotfill();
		//设置初始值
		for(var i=0;i<checklist.length;i++){
			if(this.arrData[checklist[i]]){
				if(this.arrData[checklist[i]][0]!=0){
					this.proviceChange(this.arrData[checklist[i]][0]);
					for(var j=0;j<pele.options.length;j++){
						if(pele.options[j].value==this.arrData[checklist[i]][0]){
							pele.options[j].selected=true;
						}
					}
				}else{
					this.proviceChange(checklist[i]);
					for(var j=0;j<pele.options.length;j++){
						if(pele.options[j].value==checklist[i]){
							pele.options[j].selected=true;
						}
					}

				}
				this.select(checklist[i]);
			}
		}
		this.ok();		
	}
	area.prototype.popupDialog = function (dialogid){	
		closeCurrentDialog();
		creatMask(1); //创建遮挡层 1为创建 0为去除
		var dialog = document.getElementById(dialogid);	
		dialog.style.display = "";		
		//dialog.style.left=(getleft(document.getElementById(this.showid))-22)+"px";
		dialog.style.left = (document.documentElement.offsetWidth - document.getElementById(dialogid).offsetWidth)/2 + document.documentElement.scrollLeft + "px";
		//if(parseInt(getleft(dialog))+parseInt(dialog.offsetWidth)>document.body.scrollWidth){			
		//	dialog.style.left=(document.body.scrollWidth-parseInt(dialog.offsetWidth))+"px";
		//}		
		//dialog.style.top = (gettop(document.getElementById(this.showid))+20)+"px";
		dialog.style.top = (document.documentElement.clientHeight - document.getElementById(dialogid).offsetHeight)/2 + document.documentElement.scrollTop + "px";
		currentPopup = dialogid;			
	}
	area.prototype.proviceChange = function (provice){	
		if(provice==0){
			this.hotfill();
		}else{
			this.fillFileds(provice);
		}
	}

	area.prototype.select = function (id,target){	
		if((target&&target.checked)||!target){				
			//如果选择的是省份,则删除包含的城市
			if(this.arrData[id][0]==0){
				var $abc=document.getElementById('citychecked');
				if($abc.childNodes.length>0){
					for(var j=$abc.childNodes.length-1;j>=0;j--){		
						var cityid=$abc.childNodes[j].childNodes[0].value;	
						if(this.arrData[cityid][0]==id){
							if(document.getElementById('cityckdiv'+cityid))
							document.getElementById('citychecked').removeChild(document.getElementById('cityckdiv'+cityid));
							if(document.getElementById('city'+cityid)){
								document.getElementById('city'+cityid).checked=false;
							}
						}
					}
				}
				
			}


			if(document.getElementById('citychecked').childNodes.length>=this.mult&&this.mult!=1){
				alert('选择请不要超过'+this.mult+'项');
				target.checked=false;
				return;
			}

			if(this.mult!=1 && this.arrData[id][0]==0){
					for(var i=0;i<document.getElementById('citylist').childNodes.length;i++){
						document.getElementById('citylist').childNodes[i].childNodes[0].disabled=true;
					}
			}			

			var citycheckdiv=document.createElement("div");
			citycheckdiv.id='cityckdiv'+id;			
			var citychecknew=document.createElement("input"); 			
			if(this.mult==1){
				citychecknew.type='radio'; 
			}else{
				citychecknew.type='checkbox';  
			}	
			citychecknew.id='citynew'+id;	
			citychecknew.value=id;
			citycheckdiv.appendChild(citychecknew);			
			citycheckdiv.appendChild(document.createTextNode(this.arrData[id][1]));
			if(this.mult==1){
				document.getElementById('citychecked').innerHTML='';
			}
			document.getElementById('citychecked').appendChild(citycheckdiv);
			citychecknew.checked=true;					
			eval("citychecknew.onclick=function(){"+this.obj+".select("+id+",this)}");
			if(document.getElementById('city'+id)){
				document.getElementById('city'+id).checked=true;
			}
		}else{
			if(document.getElementById('cityckdiv'+id))
			document.getElementById('citychecked').removeChild(document.getElementById('cityckdiv'+id));
			if(document.getElementById('city'+id)){
				document.getElementById('city'+id).checked=false;
			}
			if(this.arrData[id][0]==0){
				for(var i=0;i<document.getElementById('citylist').childNodes.length;i++){
					document.getElementById('citylist').childNodes[i].childNodes[0].disabled=false;
				}
			}
		}
	}
	area.prototype.all=function(target){
		document.getElementById('citychecked').innerHTML='';
		var _ele=document.getElementById('citylist');	
		if(_ele.childNodes.length>=0){
			if(target.checked){
				 for(var i=0;i<_ele.childNodes.length;i++){
					 _ele.childNodes[i].childNodes[0].checked=false;
					_ele.childNodes[i].childNodes[0].disabled =true;
				 }
				 if(document.getElementById('pcheck').childNodes.length>0){
					document.getElementById('pcheck').childNodes[0].checked=false;
					document.getElementById('pcheck').childNodes[0].disabled=true;
				 }
				 var citycheckdiv=document.createElement("div");
				citycheckdiv.id='cityckdiv'+0;			
				var citychecknew=document.createElement("input"); 			
				citychecknew.type='checkbox';  			
				citychecknew.id='citynew'+0;	
				citychecknew.value=0;
				citycheckdiv.appendChild(citychecknew);			
				citycheckdiv.appendChild(document.createTextNode('不限'));
				document.getElementById('citychecked').appendChild(citycheckdiv);
				citychecknew.checked=true;							
				eval("citychecknew.onclick=function(){"+this.obj+".all(this)}");					
			}else{
				document.getElementById('areaall').checked=false;
				 for(var i=0;i<_ele.childNodes.length;i++){
					_ele.childNodes[i].childNodes[0].disabled =false;
				 }
				 if(document.getElementById('pcheck').childNodes.length>0){
					document.getElementById('pcheck').childNodes[0].disabled=false;
				 }
			}
		}
	}
	area.prototype.ok=function(){
		if(this.mult!=1){
			document.getElementById(this.eleid).value=',';
		}else{
			document.getElementById(this.eleid).value='';
		}
		document.getElementById(this.showid).innerHTML=''; 		
		var $abc=document.getElementById('citychecked');
		if($abc.childNodes.length>0){					
			for(var j=0;j<$abc.childNodes.length;j++){		
				if(this.mult==1){
					document.getElementById(this.eleid).value+=$abc.childNodes[j].childNodes[0].value;				
				}else{
					document.getElementById(this.eleid).value+=$abc.childNodes[j].childNodes[0].value+',';		
				}
				if(document.getElementById(this.showid).innerHTML!=''){
					document.getElementById(this.showid).innerHTML+="+"+this.arrData[$abc.childNodes[j].childNodes[0].value][1];
				}else{
					if(this.arrData[$abc.childNodes[j].childNodes[0].value]){
						document.getElementById(this.showid).innerHTML+=this.arrData[$abc.childNodes[j].childNodes[0].value][1];
					}else if($abc.childNodes[j].childNodes[0].value==0){
						document.getElementById(this.showid).innerHTML = "不限";
					}else{
						document.getElementById(this.showid).innerHTML = "请选择";
					}
				}
			}
		}else{
			document.getElementById(this.eleid).value='0'; 
			document.getElementById(this.showid).innerHTML='<span class=c2>请选择</span>';
		}
		document.getElementById('strareaid').value=document.getElementById(this.showid).innerHTML;
		closeCurrentDialog();
	}
	area.prototype.fillFileds=function(provice){
		document.getElementById('pcheck').innerHTML='';
		//document.getElementById('pcheck').style.display='none';

		var fileds="";
		var count=0;
		for(var i in this.arrData){			
			if(this.arrData[i][0]==provice){ 	
				if(this.mult==1){
					fileds+="<div><input name=\"radioarea\" onclick=\""+this.obj+".select("+i+",this)\" type='radio' id='city"+i+"'";
				}else{
					fileds+="<div><input onclick=\""+this.obj+".select("+i+",this)\" type='checkbox' id='city"+i+"'";
				}
				var $abc=document.getElementById('citychecked');
				if($abc.childNodes.length>0){					
					for(var j=0;j<$abc.childNodes.length;j++){
						if($abc.childNodes[j].childNodes[0].value==i){
							fileds+=" checked";	
						}
					}
				}
				fileds+="><NOBR>"+this.arrData[i][1]+"</NOBR></div>";
				count++;
			}
		}				
		document.getElementById(this.list).innerHTML=fileds;	
		
		if(count>1){
			document.getElementById('pcheck').style.display='';
			if(this.mult==1){
				document.getElementById('pcheck').innerHTML="<input id='city"+provice+"' name=\"radioarea\" type=\"radio\" value=\""+provice+"\" onclick=\""+this.obj+".select("+provice+",this)\"><strong>"+this.arrData[provice][1]+"</strong>(选择此大类,将包括以下小类)";
			}else{
				document.getElementById('pcheck').innerHTML="<input id='city"+provice+"' name=\"radioarea\" type=\"checkbox\" value=\""+provice+"\" onclick=\""+this.obj+".select("+provice+",this)\"><strong>"+this.arrData[provice][1]+"</strong>(选择此大类,将包括以下小类)";
			}
		}

		var $abc=document.getElementById('citychecked');
		if($abc.childNodes.length>0){					
			for(var j=0;j<$abc.childNodes.length;j++){
				if($abc.childNodes[j].childNodes[0].value==provice){
					document.getElementById('city'+provice).checked=true;
					if(this.mult!=1){
						for(var i=0;i<document.getElementById('citylist').childNodes.length;i++){
							document.getElementById('citylist').childNodes[i].childNodes[0].disabled=true;
						}
					}
					break;
				}
			}
		}

	} 	





	function job(){
		this.eleid=null;//用来存放分类ID的元素
		this.arrData=null;//分类数组
		this.pathid=null;//用来存放分类路径的元素		
		this.obj=null;//引用本身
		this.showid=null;//用于显示的元素
		this.list='jobslist';
		this.mult=5;
	}

	job.prototype.hotfill = function(){
		var fileds="";
		var count=0; 		
		for(var i in this.arrData){			
			if(this.arrData[i][2]==1){
				if(this.mult==1){
					fileds+="<div><input name=\"radiojob\" onclick=\""+this.obj+".select("+i+",this)\" type='radio' id='jobs"+i+"'";
				}else{
					fileds+="<div><input onclick=\""+this.obj+".select("+i+",this)\" type='checkbox' id='jobs"+i+"'";
				}
				var $abc=document.getElementById('jobchecked');
				if($abc.childNodes.length>0){					
					for(var j=0;j<$abc.childNodes.length;j++){
						if($abc.childNodes[j].childNodes[0].value==i){
							fileds+=" checked";	
						}
					}
				}
				fileds+="><NOBR>"+this.arrData[i][1]+"</NOBR></div>";
				count++;
			}
		}				
		document.getElementById(this.list).innerHTML=fileds;
	}
	job.prototype.init = function (){
		var pele = document.getElementById('jobselect');	
		pele.options[pele.length]=new Option('请选择',0);
		for(var i in this.arrData){
			if(this.arrData[i][0]==0){
				pele.options[pele.length]=new Option(this.arrData[i][1],i);
			}
		}		
		//this.fillFileds(pele.value);
		this.hotfill();
		if(document.getElementById(this.eleid).value){
			var strselect=document.getElementById(this.eleid).value;
			var checklist=new Array();
			if(strselect.indexOf(',')!=-1){
				strselect=strselect.substr(1,document.getElementById(this.eleid).value.length-2);
				checklist=strselect.split(',');
			}else{
				checklist[0]=strselect;
			}
			for(var i=0;i<checklist.length;i++){	
				if(this.arrData[checklist[i]]){
					var jobscheckdiv=document.createElement("div");
					jobscheckdiv.id='jobsckdiv'+checklist[i];			
					var jobschecknew=document.createElement("input"); 		
					if(this.mult==1){
						jobschecknew.type='radio';
					}else{
						jobschecknew.type='checkbox';  		
					}
					jobschecknew.id='jobsnew'+checklist[i];	
					jobschecknew.value=checklist[i];
					jobscheckdiv.appendChild(jobschecknew);				
					jobscheckdiv.appendChild(document.createTextNode(this.arrData[checklist[i]][1]));
					document.getElementById('jobchecked').appendChild(jobscheckdiv);
					jobschecknew.checked=true;							
					eval("jobschecknew.onclick=function(){"+this.obj+".select("+checklist[i]+",this)}");	
				}
				
			}
			this.ok();
		}
	}
	job.prototype.popupDialog = function (dialogid){
		closeCurrentDialog();
		creatMask(1); //创建遮挡层 1为创建 0为去除
		var dialog = document.getElementById(dialogid);	
		dialog.style.display = "";		
		//dialog.style.left=(getleft(document.getElementById(this.showid))-22)+"px";		
		//if(parseInt(getleft(dialog))+parseInt(dialog.offsetWidth)>document.body.scrollWidth){			
		//	dialog.style.left=(document.body.scrollWidth-parseInt(dialog.offsetWidth))+"px";
		//}		
		//dialog.style.top = (gettop(document.getElementById(this.showid))+20)+"px";		
		dialog.style.left = (document.documentElement.offsetWidth - document.getElementById(dialogid).offsetWidth)/2 + document.documentElement.scrollLeft + "px";
		dialog.style.top = (document.documentElement.clientHeight - document.getElementById(dialogid).offsetHeight)/2 + document.documentElement.scrollTop + "px";
		currentPopup = dialogid;	
	}
	job.prototype.selectChange = function (provice){	
		if(provice==0){
			this.hotfill();
		}else{
			this.fillFileds(provice.value);
		}
	}

	job.prototype.select = function (id,target){		
		if(target.checked){				
			if(document.getElementById('jobchecked').childNodes.length>=this.mult&&this.mult!=1){
				alert('选择请不要超过'+this.mult+'项');
				target.checked=false;
				return;
			}  			
			var jobscheckdiv=document.createElement("div");
			jobscheckdiv.id='jobsckdiv'+id;			
			var jobschecknew=document.createElement("input"); 
			if(this.mult==1){
				jobschecknew.type='radio';  			
			}else{
				jobschecknew.type='checkbox';  	
			}
			jobschecknew.id='jobsnew'+id;	
			jobschecknew.value=id;
			jobscheckdiv.appendChild(jobschecknew);			
			jobscheckdiv.appendChild(document.createTextNode(this.arrData[id][1]));
			if(this.mult==1){
				document.getElementById('jobchecked').innerHTML='';
			}
			document.getElementById('jobchecked').appendChild(jobscheckdiv);
			jobschecknew.checked=true;					
			eval("jobschecknew.onclick=function(){"+this.obj+".select("+id+",this)}");				
		}else{
			if(document.getElementById('jobsckdiv'+id))
			document.getElementById('jobchecked').removeChild(document.getElementById('jobsckdiv'+id));
			if(document.getElementById('jobs'+id)){
				document.getElementById('jobs'+id).checked=false;
			}
		}
	}
	job.prototype.all=function(target){
		document.getElementById('jobchecked').innerHTML='';
		var _ele=document.getElementById(this.list);	
		if(_ele.childNodes.length>=0){
			if(target.checked){
				 for(var i=0;i<_ele.childNodes.length;i++){
					 _ele.childNodes[i].childNodes[0].checked=false;
					_ele.childNodes[i].childNodes[0].disabled =true;
				 }
				 var jobscheckdiv=document.createElement("div");
				jobscheckdiv.id='jobsckdiv'+0;			
				var jobschecknew=document.createElement("input"); 			
				jobschecknew.type='checkbox';  			
				jobschecknew.id='jobsnew'+0;	
				jobschecknew.value=0;
				jobscheckdiv.appendChild(jobschecknew);			
				jobscheckdiv.appendChild(document.createTextNode('不限'));
				document.getElementById('jobchecked').appendChild(jobscheckdiv);
				jobschecknew.checked=true;							
				eval("jobschecknew.onclick=function(){"+this.obj+".all(this)}");					
			}else{
				document.getElementById('jobsall').checked=false;
				 for(var i=0;i<_ele.childNodes.length;i++){
					_ele.childNodes[i].childNodes[0].disabled =false;
				 }
			}
		}
	}
	job.prototype.ok=function(){
		if(this.mult!=1){
			document.getElementById(this.eleid).value=','; 
		}else{
			document.getElementById(this.eleid).value=''; 
		}
		document.getElementById(this.showid).innerHTML=''; 		
		var $abc=document.getElementById('jobchecked');
		if($abc.childNodes.length>0){					
			for(var j=0;j<$abc.childNodes.length;j++){
				if(this.mult==1){
					document.getElementById(this.eleid).value+=$abc.childNodes[j].childNodes[0].value;
				}else{
					document.getElementById(this.eleid).value+=$abc.childNodes[j].childNodes[0].value+',';
				}
				if(document.getElementById(this.showid).innerHTML!=''){
					document.getElementById(this.showid).innerHTML+="+"+this.arrData[$abc.childNodes[j].childNodes[0].value][1];
				}else{
					if(this.arrData[$abc.childNodes[j].childNodes[0].value]){
						document.getElementById(this.showid).innerHTML+=this.arrData[$abc.childNodes[j].childNodes[0].value][1];
					}else if($abc.childNodes[j].childNodes[0].value==0){
						document.getElementById(this.showid).innerHTML='不限';
					}else{
						document.getElementById(this.showid).innerHTML='请选择';
					}
				}
			}
		}else{
			document.getElementById(this.eleid).value='0'; 
			document.getElementById(this.showid).innerHTML='<span class=c2>请选择</span>';
		}
		document.getElementById('strjobsid').value=document.getElementById(this.showid).innerHTML;
		closeCurrentDialog();
	}

	


	job.prototype.fillFileds=function(provice){		
		var fileds="";
		var count=0; 		
		for(var i in this.arrData){			
			if(this.arrData[i][0]==provice){
				if(this.mult==1){
					fileds+="<div><input name=\"radiojob\" onclick=\""+this.obj+".select("+i+",this)\" type='radio' id='jobs"+i+"'";
				}else{
					fileds+="<div><input onclick=\""+this.obj+".select("+i+",this)\" type='checkbox' id='jobs"+i+"'";
				}
				var $abc=document.getElementById('jobchecked');
				if($abc.childNodes.length>0){					
					for(var j=0;j<$abc.childNodes.length;j++){
						if($abc.childNodes[j].childNodes[0].value==i){
							fileds+=" checked";	
						}
					}
				}
				fileds+="><NOBR>"+this.arrData[i][1]+"</NOBR></div>";
				count++;
			}
		}				
		document.getElementById(this.list).innerHTML=fileds;		
	} 	



	function skill(){
		this.eleid=null;//用来存放分类ID的元素
		this.arrData=null;//分类数组
		this.pathid=null;//用来存放分类路径的元素		
		this.obj=null;//引用本身
		this.showid=null;//用于显示的元素
		this.list='skilllist';
		this.mult=5;
	}
	skill.prototype.init = function (){
		var pele = document.getElementById('skillselect');	
		for(var i in this.arrData){
			if(this.arrData[i][0]==0){
				pele.options[pele.length]=new Option(this.arrData[i][1],i);
			}
		}		
		this.fillFileds(pele.value);
		
		if(document.getElementById(this.eleid).value){
			var strselect=document.getElementById(this.eleid).value.substr(1,document.getElementById(this.eleid).value.length-2);
			var checklist=strselect.split(',');			
			for(var i=0;i<checklist.length;i++){	
				if(this.arrData[checklist[i]]){
					var skillcheckdiv=document.createElement("div");
					skillcheckdiv.id='skillckdiv'+checklist[i];			
					var skillchecknew=document.createElement("input"); 			
					skillchecknew.type='checkbox';  			
					skillchecknew.id='skillnew'+checklist[i];	
					skillchecknew.value=checklist[i];
					skillcheckdiv.appendChild(skillchecknew);				
					skillcheckdiv.appendChild(document.createTextNode(this.arrData[checklist[i]][1]));
					document.getElementById('skillchecked').appendChild(skillcheckdiv);
					skillchecknew.checked=true;							
					eval("skillchecknew.onclick=function(){"+this.obj+".select("+checklist[i]+",this)}");	
				}
			}
			this.ok();
		}
	}
	skill.prototype.popupDialog = function (dialogid){
		closeCurrentDialog();
		var dialog = document.getElementById(dialogid);	
		dialog.style.display = "";		
		dialog.style.left=getleft(document.getElementById(this.showid))+"px";		
		if(parseInt(getleft(dialog))+parseInt(dialog.offsetWidth)>document.body.scrollWidth){			
			dialog.style.left=(document.body.scrollWidth-parseInt(dialog.offsetWidth))+"px";
		}		
		dialog.style.top = gettop(document.getElementById(this.showid))+"px";		
		currentPopup = dialogid;	
	}
	skill.prototype.selectChange = function (provice){			
		this.fillFileds(provice.value);
	}

	skill.prototype.select = function (id,target){		
		if(target.checked){				
			if(document.getElementById('skillchecked').childNodes.length>=5){
				alert('选择请不要超过5项');
				target.checked=false;
				return;
			}  			
			var skillcheckdiv=document.createElement("div");
			skillcheckdiv.id='skillckdiv'+id;			
			var skillchecknew=document.createElement("input"); 			
			skillchecknew.type='checkbox';  			
			skillchecknew.id='skillnew'+id;	
			skillchecknew.value=id;
			skillcheckdiv.appendChild(skillchecknew);			
			skillcheckdiv.appendChild(document.createTextNode(this.arrData[id][1]));
			document.getElementById('skillchecked').appendChild(skillcheckdiv);
			skillchecknew.checked=true;					
			eval("skillchecknew.onclick=function(){"+this.obj+".select("+id+",this)}");				
		}else{
			if(document.getElementById('skillckdiv'+id))
			document.getElementById('skillchecked').removeChild(document.getElementById('skillckdiv'+id));
			if(document.getElementById('skill'+id)){
				document.getElementById('skill'+id).checked=false;
			}
		}
	}
	skill.prototype.ok=function(){
		document.getElementById(this.eleid).value=','; 
		document.getElementById(this.showid).innerHTML=''; 		
		var $abc=document.getElementById('skillchecked');
		if($abc.childNodes.length>0){					
			for(var j=0;j<$abc.childNodes.length;j++){
				document.getElementById(this.eleid).value+=$abc.childNodes[j].childNodes[0].value+',';
				if(document.getElementById(this.showid).innerHTML!=''){
					document.getElementById(this.showid).innerHTML+="+"+this.arrData[$abc.childNodes[j].childNodes[0].value][1];
				}else{
					document.getElementById(this.showid).innerHTML+=this.arrData[$abc.childNodes[j].childNodes[0].value][1];
				}
			}
		}else{
			document.getElementById(this.eleid).value='0'; 
			document.getElementById(this.showid).innerHTML='请选择';
		}
		document.getElementById('strskillid').value=document.getElementById(this.showid).innerHTML;
		closeCurrentDialog();
	}
	skill.prototype.fillFileds=function(provice){		
		var fileds="";
		var count=0; 		
		for(var i in this.arrData){			
			if(this.arrData[i][0]==provice){ 				
				fileds+="<div><input onclick=\""+this.obj+".select("+i+",this)\" type='checkbox' id='skill"+i+"'";
				var $abc=document.getElementById('skillchecked');
				if($abc.childNodes.length>0){					
					for(var j=0;j<$abc.childNodes.length;j++){
						if($abc.childNodes[j].childNodes[0].value==i){
							fileds+=" checked";	
						}
					}
				}
				fileds+="><NOBR>"+this.arrData[i][1]+"</NOBR></div>";
				count++;
			}
		}				
		document.getElementById(this.list).innerHTML=fileds;		
	}


	function industry(){
		this.eleid=null;//用来存放分类ID的元素
		this.arrData=null;//分类数组  		
		this.obj=null;//引用本身
		this.showid=null;//用于显示的元素  		
		this.list='filedlist';
		this.mult=1;//是否允许多选
	}
	industry.prototype.init = function (){
		this.fillFileds();
		//alert(document.getElementById(this.eleid).value);
		if(document.getElementById(this.eleid).value){
			//alert(document.getElementById(this.eleid).value);
			var strselect=document.getElementById(this.eleid).value;
			var checklist=new Array();
			if(strselect.indexOf(',')!=-1){
				strselect=strselect.substr(1,document.getElementById(this.eleid).value.length-2);
				checklist=strselect.split(',');
			}else{
				checklist[0]=strselect;
			}
			for(var i=0;i<checklist.length;i++){				
				var fieldcheckdiv=document.createElement("div");
				fieldcheckdiv.id='fieldckdiv'+checklist[i];			
				var fieldchecknew=document.createElement("input"); 			
				fieldchecknew.type='checkbox';  			
				fieldchecknew.id='fieldnew'+checklist[i];	
				fieldchecknew.value=checklist[i];
				fieldcheckdiv.appendChild(fieldchecknew);				
				fieldcheckdiv.appendChild(document.createTextNode(this.arrData[checklist[i]]));
				document.getElementById('fieldchecked').appendChild(fieldcheckdiv);
				fieldchecknew.checked=true;							
				eval("fieldchecknew.onclick=function(){"+this.obj+".select("+checklist[i]+",this)}");	
				
			}
			this.ok();
		}


			
	}
	industry.prototype.popupDialog = function (dialogid){
		closeCurrentDialog();
		creatMask(1); //创建遮挡层 1为创建 0为去除
		var dialog = document.getElementById(dialogid);
		dialog.style.display = "";
		dialog.style.zIndex=2;
		//dialog.style.left=(getleft(document.getElementById(this.showid))-22)+"px";	
		//if(dialog.style.left+dialog.style.offsetWidth>document.body.scrollWidth){
		//	dialog.style.right=0;
		//}
		//dialog.style.top = (gettop(document.getElementById(this.showid))+20)+"px";  		
		dialog.style.left = (document.documentElement.offsetWidth - document.getElementById(dialogid).offsetWidth)/2 + document.documentElement.scrollLeft + "px";
		dialog.style.top = (document.documentElement.clientHeight - document.getElementById(dialogid).offsetHeight)/2 + document.documentElement.scrollTop + "px";
		currentPopup = dialogid;
		dialog.focus();
		//dialog.onblur = function(){			
		//	closeCurrentDialog();
		//}
	}
	industry.prototype.all=function(target){
		document.getElementById('fieldchecked').innerHTML='';
		var _ele=document.getElementById('filedlist');		
		if(_ele.childNodes.length>=0){
			if(target.checked){
				 for(var i=0;i<_ele.childNodes.length;i++){
					 _ele.childNodes[i].childNodes[0].checked=false;
					_ele.childNodes[i].childNodes[0].disabled =true;
				 }
				 var fieldcheckdiv=document.createElement("div");
				fieldcheckdiv.id='fieldckdiv'+0;			
				var fieldchecknew=document.createElement("input"); 			
				fieldchecknew.type='checkbox';  			
				fieldchecknew.id='fieldnew'+0;	
				fieldchecknew.value=0;
				fieldcheckdiv.appendChild(fieldchecknew);			
				fieldcheckdiv.appendChild(document.createTextNode('不限'));
				document.getElementById('fieldchecked').appendChild(fieldcheckdiv);
				fieldchecknew.checked=true;							
				eval("fieldchecknew.onclick=function(){"+this.obj+".all(this)}");					
			}else{
				document.getElementById('all').checked=false;
				 for(var i=0;i<_ele.childNodes.length;i++){
					_ele.childNodes[i].childNodes[0].disabled =false;
				 }

			}
		}
	}
	industry.prototype.ok=function(){
		if(this.mult!=1){
			document.getElementById(this.eleid).value=','; 
		}else{
			document.getElementById(this.eleid).value=''; 
		}
		document.getElementById(this.showid).innerHTML='';
		var $abc=document.getElementById('fieldchecked');
		if($abc.childNodes.length>0){					
			for(var j=0;j<$abc.childNodes.length;j++){
				if($abc.childNodes[j].childNodes[0].value!=0){
					if(this.mult==1){
						document.getElementById(this.eleid).value+=$abc.childNodes[j].childNodes[0].value;
					}else{
						document.getElementById(this.eleid).value+=$abc.childNodes[j].childNodes[0].value+',';
					}
					if(document.getElementById(this.showid).innerHTML!=''){
						document.getElementById(this.showid).innerHTML+="+"+this.arrData[$abc.childNodes[j].childNodes[0].value];
					}else{
						document.getElementById(this.showid).innerHTML+=this.arrData[$abc.childNodes[j].childNodes[0].value];
					}
				}else{
					document.getElementById(this.showid).innerHTML='不限';
					document.getElementById(this.eleid).value=0;
				}
			}
		}else{
			document.getElementById(this.eleid).value='0'; 
			document.getElementById(this.showid).innerHTML='请选择';
		}
		document.getElementById('strfieldid').value=document.getElementById(this.showid).innerHTML;
		closeCurrentDialog();
	}
	industry.prototype.select = function (id,target){	  		
		if(target.checked){				
			if(document.getElementById('fieldchecked').childNodes.length>=this.mult&&this.mult!=1){
				alert('选择请不要超过'+this.mult+'项');
				target.checked=false;
				return;
			}  			
			var fieldcheckdiv=document.createElement("div");
			fieldcheckdiv.id='fieldckdiv'+id;			
			var fieldchecknew=document.createElement("input"); 	
			if(this.mult!=1){
				fieldchecknew.type='checkbox';
			}else{
				fieldchecknew.type='radio';
			}
			fieldchecknew.id='fieldnew'+id;	
			fieldchecknew.value=id;
			fieldcheckdiv.appendChild(fieldchecknew);			
			fieldcheckdiv.appendChild(document.createTextNode(this.arrData[id]));
			if(this.mult==1){
				document.getElementById('fieldchecked').innerHTML='';
			}
			document.getElementById('fieldchecked').appendChild(fieldcheckdiv);
			fieldchecknew.checked=true;							
			eval("fieldchecknew.onclick=function(){"+this.obj+".select("+id+",this)}");				
		}else{
			if(document.getElementById('fieldckdiv'+id))
			document.getElementById('fieldchecked').removeChild(document.getElementById('fieldckdiv'+id));
			if(document.getElementById('field'+id)){
				document.getElementById('field'+id).checked=false;
			}
		}
	}
	industry.prototype.fillFileds=function(){
		var fileds="";
		for(var i=0;i<this.arrData.length;i++){
			if(this.arrData[i]){
				fileds+="<div>";
				if(this.mult!=1){
					fileds+="<input id=\"field"+i+"\" type='checkbox' value='"+i+"' onclick='"+this.obj+".select("+i+",this)'>";
				}else{
					fileds+="<input id=\"field"+i+"\" type='radio' name='industry' value='"+i+"' onclick='"+this.obj+".select("+i+",this)'>";
				}
				fileds+=this.arrData[i][0]+"</div>";
			}
			//alert(this.arrData[$i]);
		} 
		//alert(fileds);
		//if(count==0){			
		//	closeCurrentDialog();			
		//}else{		
		document.getElementById(this.list).innerHTML=fileds;		
		//}
	}
	
	
	
	function creatMask(s){
		if(typeof(area)!="undefined") document.getElementById("area").style.zIndex=5;
		if(typeof(field)!="undefined") document.getElementById("field").style.zIndex=5;
		if(typeof(job)!="undefined") document.getElementById("job").style.zIndex=5;
		
		var Maskdiv = document.getElementById('creatMaskLayer');
		if(!Maskdiv && s==1){
			Maskdiv = document.createElement("DIV");
			Maskdiv.id="creatMaskLayer";
			document.body.appendChild(Maskdiv);
			var Maskheight=document.body.clientHeight;
			var Maskwidth = document.body.offsetWidth;
			Maskdiv.style.cssText=(" position:absolute; left:0; top:0; width:"+Maskwidth+"px; height:"+Maskheight+"px; z-index:1; border:1px solid #ccc; background:#828282; filter:Alpha(Opacity='0',FinishOpacity='50',Style='2');");
			Maskdiv.style.opacity = 40/100;
			Maskdiv.style.MozOpacity = 40/100;
		}else if(s==0){
			if(typeof(Maskdiv)!="undefined"){
				document.body.removeChild(Maskdiv);
			}
		}		
	}

	function moveLayer(moveid,targetid){
		
		
	}
