//多选函数
function change(){
	
	var length =document.getElementsByName("selectEpp").length;
	var userId ="";
	var userUnID="";
	for (var i=0;i<length;i++){
		if(document.getElementsByName("selectEpp")[i].checked){
			userId +=document.getElementsByName("selectEpp")[i].value+",";
			
		}
	}
	for (var i=0;i<length;i++){
		if(!document.getElementsByName("selectEpp")[i].checked){
			var s=document.getElementsByName("selectEpp")[i].value;
			var sm =s.split(":");
			window.parent.MainFrame.del(sm[0]);
		}
	}
	
	if(userId!=null && userId != ""){
		window.parent.MainFrame.setDeptAndEmployee(userId.substring(0,userId.lastIndexOf(",")));
	}
}
//全选函数
function selectedAll(){
	 var s=$("#check_all").val();
	if (s=='qb') {
		var length =document.getElementsByName("selectEpp").length;
	     	for (var i=0;i<length;i++){
	     		 document.getElementsByName("selectEpp")[i].checked = true;
				 
		 }
		 $("#check_all").val("qc");
	} else {
		var length =document.getElementsByName("selectEpp").length;
		for (var i=0;i<length;i++){
			document.getElementsByName("selectEpp")[i].checked = false;
			
		}
			$("#check_all").val("qb");
	}		
	change();
}
//全不选函数
function selectedNone(){
	var length =document.getElementsByName("selectEpp").length;
	for (var i=0;i<length;i++){
		document.getElementsByName("selectEpp")[i].checked = false;
	}
}
//带参数的函数
function folderview(url){
	window.parent.MainFrame.setDeptAndEmployee(url);
}
//带返回值的函数
function divAll(){
	var s=window.parent.MainFrame.divAll();
	debugger;
	if(s!=null && s!=''){
	var st =s.split(",");
	for( var j=0;j<st.length;j++){
		var length =document.getElementsByName("selectEpp").length;
		if(length!=null){
			for (var i=0;i<length;i++){
				if(document.getElementsByName("selectEpp")[i].value ==st[j] ){
					document.getElementsByName("selectEpp")[i].checked=true;
				}
  			}
		}
		
	}
	}
}
//回选函数
function setDeptAndEmployee(url){
	var su =document.getElementsByName("selectEpp").length;
	
	for( var i=0;i<su;i++){
	var sdi=document.getElementsByName("selectEpp")[i].value.split(":");
		if(sdi[0] == url){
			document.getElementsByName("selectEpp")[i].checked = false;
		}
	}
}