//

//列出所有已加人员代码////////////////////////////////////////////////////////////////////////////
var g_cutUserNameStrLen = 30;
var g_aEmps = null;
var isEmpInfo = false;
//回调函数，每得到一条设备信息被调用一次
function OnEmployeeItem(szItem)
{
	eval('var item = ' + szItem);
	//item.nCode 错误码。为1时表示列表线程开始，其它成员无效，为2时表示线程结束，其它成员无效，为0时表示一行数据除szMsg成员无效外，其它成员都有效。小于0时表示出错，下面的成员除szMsg外都无效
	//item.szMsg 当出错时该成员才有效，包含错误的文本信息。
	//item.nID 人员在数据库中的ID号
	//item.szName 人员姓名
	//item.szCode 人员编号（工号）
	//item.dwGender 性别。0表示男，1表示女
	//item.dwFlag 属性标志。其中第7位置位表示为管理员。设置时应使用 (item.dwFlag | 128)，清除时应使用(item.dwFlag & ~128)	
	//item.nDepartment 部门ID
	//item.szDepartment 部门名称
	//item.szBirthday 生日
	//item.szTitle 职位
	//item.szEducation 教育程度
	//item.szTel 电话
	//item.szAddress 家庭住址
	//item.szRemark 备注
	//item.szPhoto 照片
	//item.szCard 卡号
	//item.szPwd 密码
	//item.szExpiryTime 超期时间
	//item.szInfo1 附加信息1
	//item.szInfo2 附加信息2
	//item.szInfo3 附加信息3
	//item.szInfo4 附加信息4
	if (item.nCode == 1)//列表线程已启动
	{
		//此时item结构如下
		//item.nCode 肯定为1
		//item.nPage 当前页页号
		//item.nRows 每页最大显示行数
		//item.nTotalPages 搜索结果总页数
		
		g_sn = 0;
		g_aEmps = new Array();		
		var info = document.getElementById("Result_Info");
		if(!g_isInitSplitPage)
		{
			g_isInitSplitPage = true;
			initSplitPageNavBySize(item.nTotalPages,item.nCode);
		}
		g_nPage = item.nPage;
		return;
	}
	else if (item.nCode == 2)
	{
		setTimeout(function(){			
			
			isEmpInfo = false;
			deleteRowsToIndexByTab("tab_list_emp_item",0);
			initInsertRows("tab_list_emp_item",gListRowsAmount*30,6,g_aEmps,false);
			},200);	
			setTimeout(function(){initBottomBtnMarginTop("div_setup_btn_pack");},202);
			setTimeout(function(){resizeSearchObj("a_add_emp","emp_search");cancelProcess();},208);
			return;
	}
	
	else if (item.nCode < 0)
	{
		alert(item.szMsg);//同时也表示操作错误完成
		isEmpInfo = false;
	}
	else if (item.nCode == 0)
	{
		/*g_Items.push(item);
		var info = document.getElementById("Result_Info");
		g_sn++;
		info.innerHTML += g_sn + " ";
		info.innerHTML += item.nID + " ";
		info.innerHTML += item.szName + " ";
		info.innerHTML += item.szCode + " ";
		info.innerHTML += item.dwGender == 0 ? "男 " : "女 ";
		info.innerHTML += item.szPwd + " ";
		info.innerHTML += (item.dwFlag & 128) != 0 ? "管理员" : "普通人员";
		info.innerHTML += "<input type=\"button\" name=\"button\"  value=\"删除\"  onclick=\"DelEmployee(" +
			(g_sn - 1) + ");\"/><input type=\"button\" name=\"button\"  value=\"修改\"  onclick=\"ModifyEmployee(" + (g_sn - 1) + ");\"/><br/>";
			*/
			g_aEmps.push(getEmpItemObj(++g_sn,item,"editEmp"));
			return;
	}
	//else
//		alert("不应该到达此处，说明VC源代码有错误。");
	cancelProcess();
}
//列出人员
function ListEmployee(empCard,empName,pageSize,nPage)
{
	g_aEmps = new Array();
	startProcess(1,null);
	/*var nPage = parseInt(document.getElementById('Emp_Page').value);*/
	//参数1为szName人员姓名过滤。参数2为szCard卡号过滤。参数3为nRows每页行数。参数4为nPage转到第几页，当nPage为0时表示首页（即0页与第1页相同），小于0时表示尾页。
	var ret = _externalListEmployee('OnEmployeeItem', pageSize, nPage, empName, empCard);
	eval ('var err = ' + ret);
	//err.nCode 错误码。大于等于0时表示无错误szMsg成员无效。小于0时表示出错。
	//err.szMsg 当出错时该成员才有效，包含错误的文本信息。
	
	if (err.nCode >= 0)
	{
		//此处应禁用所有按钮，只允许取消按钮可以操作
		return 0;
	}
	alert(err.szMsg);
	cancelProcess();
}
function getEmpItemObj(g_sn,item,editMethodName)
{
	/*var btnDel = '<div style="float:left;margin-left:3px;width:37px;height:28px;background:url(images/btns.png) -214px -56px no-repeat;cursor:pointer;" onclick="DelDevice(this.parentNode.parentNode);" onmouseover ="modifyObjBkImgPosByOver(this,true,-214,-56,-214,-28);" onmouseout ="modifyObjBkImgPosByOver(this,false,-214,-56,-214,-28);"></div>';
	var btnModify = '<div style="float:left;margin-left:3px;width:37px;height:28px;background:url(images/btns.png) -178px -28px no-repeat;cursor:pointer;" onclick="'+editMethodName+'(this);" onmouseover ="modifyObjBkImgPosByOver(this,true,-178,-28,-178,0);" onmouseout ="modifyObjBkImgPosByOver(this,false,-178,-28,-178,0);"></div>';
	var btnStr = '<div style="width:80px;height:28px;">'+btnDel+btnModify+'</div>';*/
	var btnDel = createSelfRectBtn("DelEmployee",-214,-56,-214,-28,3,item);
	var btnModify = createSelfRectBtn("editEmp",-178,-28,-178,0,3,item);
	var pack  = document.createElement("div");
	pack.style.cssText = "width:80px;height:28px;";
	pack.appendChild(btnModify);
	pack.appendChild(btnDel);
	return new Array((g_nPage - 1) * g_pageSize+g_sn,item.szName,item.szCode,item.szCard,(item.szPwd == "")?"":"******",((item.dwGender != 0) ? getLanTextByKey("FEMALE_TITLE") : getLanTextByKey("MALE_TITLE")),((item.dwFlag & 128) != 0 ? getLanTextByKey("T_ADMIN") : getLanTextByKey("GENERAL_EMP_TITLE")),pack,[{"condition":0,"trBkColor":"0","tips":""}]);				
}
/////批量加信息，暂时取消//////////////插入设备加人员信息卡、指纹、人脸到弹出式窗口中
function getAddInfoEventUI(mode,item,sn)
{
	var cellStyleText = "border:#ccc solid 0px;";
	var tab = document.createElement("table");
	tab.style.cssText = "margin-top:10px;margin-left:10px;";
	tab.className = "tab_list";
	tab.cellPadding = "0";
	tab.cellSpacing = "0";
	var row = tab.insertRow();
	var cell  = row.insertCell();
	cell.style.cssText = cellStyleText;
	cell.innerText = "序号：";
	cell  = row.insertCell();	
	cell.style.cssText = cellStyleText;
	cell.innerText = sn;
	
	row = tab.insertRow();
	cell  = row.insertCell();
	cell.style.cssText = cellStyleText;
	cell.innerText = "姓名：";
	cell  = row.insertCell();	
	cell.style.cssText = cellStyleText;
	cell.innerText = item.szName;
	
	row = tab.insertRow();
	cell  = row.insertCell();
	cell.style.cssText = cellStyleText;
	cell.innerText = "编号：";
	cell  = row.insertCell();	
	cell.style.cssText = cellStyleText;
	cell.innerText = item.szCode;
	/*info.innerHTML += item.nID + " ";
		info.innerHTML += item.szName + " ";
		info.innerHTML += item.szCode + " ";
		info.innerHTML += item.dwGender == 0 ? "男 " : "女 ";
		info.innerHTML += item.szPwd + " ";
		info.innerHTML += (item.dwFlag & 128) != 0 ? "管理员" : "普通人员";*/
	row = tab.insertRow();
	cell  = row.insertCell();
	cell.style.cssText = cellStyleText;
	cell.innerText = "卡号：";
	cell  = row.insertCell();	
	cell.style.cssText = cellStyleText;
	cell.id = "td_card_number";
	cell.innerText = (item.szCard == -1)?"":item.szCard;
	if(item.szCard == -1)
	{
		getSkipNumber(cell,200);
		cell.style.color = "#00ccff";
		cell.style.fontWeight = "400";
	}
	else
	{
		cell.style.color = "#000";
		cell.style.fontWeight = "normal";
	}
	row = tab.insertRow();
	cell  = row.insertCell();
	cell.style.cssText = cellStyleText;
	cell.innerText = "指纹：";
	cell  = row.insertCell();	
	cell.style.cssText = cellStyleText;
	cell.innerText = item.szName;
	
	row = tab.insertRow();
	cell  = row.insertCell();
	cell.valign = "middle";
	cell.style.cssText = cellStyleText;
	cell.innerText = "设备：";
	cell  = row.insertCell();	
	cell.valign = "middle";
	cell.style.cssText = cellStyleText;
	var aDevice = new Array();
	var seleceDefault = {"text":"--请选择--","val":-1,"posX":-196,"posY":-133,"modifyPosX":-196,"modifyPosY":-115};
	var device1 = {"text":"门口一体机1","val":0,"posX":-196,"posY":-133,"modifyPosX":-196,"modifyPosY":-115};
	var device2 = {"text":"门口一体机1","val":1,"posX":-196,"posY":-133,"modifyPosX":-196,"modifyPosY":-115};
	var device3 = {"text":"门口一体机1","val":2,"posX":-196,"posY":-133,"modifyPosX":-196,"modifyPosY":-115};
	aDevice.push(seleceDefault);
	aDevice.push(device1);
	aDevice.push(device2);
	aDevice.push(device3);
	cell.appendChild(initSelectObj("div_select_device",aDevice,false,""));
	
	return tab;
}
var numInterval = null;
function getSkipNumber(obj,ms)
{
	numInterval = setInterval(function(){
		var rand = getRandomByUnit(8);
		obj.innerHTML = rand;
		},ms);
}
function getRandomByUnit(numberUnit)
{
	var baseNum = 1;
	for(var i = 0; i < numberUnit; i++)
		baseNum *= 10;
	return parseInt(Math.random() * baseNum,10);	
}
//////批量加信息，暂时取消////////////
function jumpToEmpsIndexPage(nIndex)
{
	ListEmployee("","",g_pageSize,nIndex);
}
function editEmp(btn)
{
	//(btn.hideContent.szName);
	var td = getFirstParentObjByTag(btn,"td");
	var tr = getFirstParentObjByTag(btn,"tr");
	var tab = getFirstParentObjByTag(btn,"table");
	g_control  = tr;
	removeEditRow(TABLE_ROW_EDIT_ID);
	var newRow = insertTabRow(tab.id,tr,false);	
	newRow.id = TABLE_ROW_EDIT_ID;
	var cell = newRow.insertCell();
	cell.colSpan = tr.cells.length;	//"姓名","编号","密码","性别","人员类型
	/*info.innerHTML += item.dwGender == 0 ? "男 " : "女 ";
		info.innerHTML += item.szPwd + " ";
		info.innerHTML += (item.dwFlag & 128) != 0 ? "管理员" : "普通人员";*/
	var aGender = new Array();
	var mJson = {"text":getLanTextByKey("MALE_TITLE"),"val":0,"posX":-196,"posY":-133,"modifyPosX":-196,"modifyPosY":-115};
	var fJson = {"text":getLanTextByKey("FEMALE_TITLE"),"val":1,"posX":-213,"posY":-133,"modifyPosX":-213,"modifyPosY":-115};
	if((btn.hideContent).dwGender == 0 )
	{
		aGender.push(mJson);	
		aGender.push(fJson);	
	}
	else
	{
		aGender.push(fJson);	
		aGender.push(mJson);	
	}
	
	var aAdmin = new Array();
	var mJson = {"text":getLanTextByKey("T_ADMIN"),"val":1,"posX":-244,"posY":-133,"modifyPosX":-244,"modifyPosY":-115};
	var gJson = {"text":getLanTextByKey("GENERAL_EMP_TITLE"),"val":0,"posX":-229,"posY":-133,"modifyPosX":-229,"modifyPosY":-115};
	if(((btn.hideContent).dwFlag & 128) != 0  )
	{
		aAdmin.push(mJson);	
		aAdmin.push(gJson);	
	}
	else
	{
		aAdmin.push(gJson);	
		aAdmin.push(mJson);	
	}
	
	var jsons = [{"name":getLanTextByKey("T_NAME"),"tips":getLanTextByKey("PLS_INPUT_USER_NAME_DESC"),"value":(btn.hideContent).szName,"id":"txt_emp_name","type":0,"data":null,"maxlen":100,"error":getLanTextByKey("T_ONLY_ACCEPT_UNIT_TIPS").replace("%1","100")},
								{"name":getLanTextByKey("T_CODE"),"tips":getLanTextByKey("PLS_INPUT_USER_CODE_DESC"),"value":(btn.hideContent).szCode,"id":"txt_emp_code","type":0,"data":null,"maxlen":20,"error":getLanTextByKey("T_ONLY_ACCEPT_UNIT_TIPS").replace("%1","20")},
								{"name":getLanTextByKey("T_PWD"),"tips":"","value":(btn.hideContent).szPwd,"id":"txt_emp_pwd","type":1,"data":null,"maxlen":6,"error":getLanTextByKey("T_ONLY_ACCEPT_NUMBER_TIPS").replace("%1","6")},
								{"name":getLanTextByKey("GENDER_TITLE"),"tips":"","value":"","id":"txt_emp_gender","type":1,"data":initSelectObj("div_select_gender",aGender,false,"")},
								{"name":getLanTextByKey("EMP_TYPE_TITLE"),"tips":"","value":"","id":"txt_emp_type","type":1,"data":initSelectObj("div_select_emp_type",aAdmin,false,"")}];//,{"name":"IP","tips":"请输入设备IP","value":"192.168.0.1"}
	initEditRowUI(cell,jsons,"ModifyEmployee", btn.hideContent);
	setTimeout(function(){
		resizeEditRowSelectMenuPos();
		resizeSearchObj("a_add_emp","emp_search");
	},0);
}
function resizeEditRowSelectMenuPos()
{
	var mLeftPos = getAbsoluteLeftByObj(document.getElementById("txt_emp_type"));
	var mTopPos = getAbsoluteTopByObj(document.getElementById("txt_emp_type"));
	var empSelectObj = document.getElementById("div_select_emp_type");
	if(empSelectObj == null)
		return;
	empSelectObj.style.left = mLeftPos + 6;
	empSelectObj.style.top = mTopPos + 2;
	
	var gLeftPos = getAbsoluteLeftByObj(document.getElementById("txt_emp_gender"));
	var gTopPos = getAbsoluteTopByObj(document.getElementById("txt_emp_gender"));
	var genderSelectObj = document.getElementById("div_select_gender");
	genderSelectObj.style.left = gLeftPos + 6;
	genderSelectObj.style.top = gTopPos + 2;
}

//人员成员修改掩码。注意：未修改成员时一定不要设置，尤其是管理员，因为可能会导致额外的设置下载。
var EMPL_MSK_NAME = 1;
var EMPL_MSK_EMPLOYEE_NUM = (1 << 2);
var EMPL_MSK_GENDER = (1 << 4);
var EMPL_MSK_ADMIN = (1 << 11);
var EMPL_MSK_PWD = (1 << 13);
function ModifyEmployee(btn)
{
	var initItem = btn.hideContent;
	var item = new Object();
	var empObj = document.getElementById("txt_emp_name");
	var codeObj = document.getElementById("txt_emp_code");
	item.szName = (empObj.value == empObj.tips)?"":empObj.value;
	item.szCode = (codeObj.value == codeObj.tips)?"":codeObj.value;
	item.szPwd = document.getElementById("txt_emp_pwd").value;
	item.dwGender = document.getElementById("div_select_gender_item_0").val;
	item.isAdmin = document.getElementById("div_select_emp_type_item_0").val;
	//alert(item.szName +" = " + item.code +" = " + item.pwd +" = " + item.gender +" = " + item.szName);
	//return;
	var dwMask = 0;
	/*info.innerHTML += g_sn + " ";
		info.innerHTML += item.nID + " ";
		info.innerHTML += item.szName + " ";
		info.innerHTML += item.szCode + " ";
		info.innerHTML += item.dwGender == 0 ? "男 " : "女 ";
		info.innerHTML += item.szPwd + " ";
		info.innerHTML += (item.dwFlag & 128) != 0 ? "管理员" : "普通人员";*/
	if (initItem.szName != item.szName)
		dwMask |= EMPL_MSK_NAME;//修改了人员名称加上本行代码
	var dwFlag = initItem.dwFlag;
	if(item.isAdmin)
		dwFlag |= 128;//设定为管理员。如果设定为普通人员应该是 dwFlag &= ~128;必须如此实现，因为其它位还有其它用途
	else
		dwFlag &= ~128;
	if (dwFlag != initItem.dwFlag)
		dwMask |= EMPL_MSK_ADMIN;//修改了是否为管理员加上本行代码
	//以下省略比较，在实际使用是一定要进行比较
	
	if (initItem.szCode != item.szCode)
		dwMask |= EMPL_MSK_EMPLOYEE_NUM;//修改了人员工号加上本行代码
	if (initItem.dwGender != item.dwGender)
		dwMask |= EMPL_MSK_GENDER;//修改了性别加上本行代码
	if (initItem.szPwd != item.szPwd)
		dwMask |= EMPL_MSK_PWD;//修改了密码加上本行代码
	var ret = _externalModifyEmployee('onModifyEmployee', dwMask, initItem.nID, item.szName, item.szCode,
		item.dwGender/*0表男性，1表女性*/, item.szPwd/*密码要么为空白，要么是6位数字*/, dwFlag, /*在这之后的参数原样传入*/
		initItem.nDepartment, initItem.szBirthday, initItem.szTitle, initItem.szEducation, initItem.szTel,
		initItem.szAddress, initItem.szRemark, initItem.szPhoto, initItem.szCard, initItem.szExpiryTime, 
		initItem.szInfo1, initItem.szInfo2, initItem.szInfo3,	initItem.szInfo4);
	eval ('var err = ' + ret);
	//err.nCode 错误码。大于等于0时表示无错误szMsg成员无效。小于0时表示出错。
	//err.szMsg 当出错时该成员才有效，包含错误的文本信息。
	if (err.nCode >= 0)
	{
		//此处应禁用所有按钮，只允许取消按钮可以操作
		startProcess(1,null);
		return 0;
	}
	alert(err.szMsg);
	cancelProcess();
}
function onModifyEmployee(szRet)
{
	eval('var err = ' + szRet);
	//err.nCode 错误码。大于等于0时表示无错误且为设备的ID号。szMsg成员无效。小于0时表示出错。
	//err.szMsg 当出错时该成员才有效，包含错误的文本信息。
	if (err.nCode < 0)
		alert(err.szMsg);
	else
		refreshPage();
	cancelProcess();
}

//增加人员代码////////////////////////////////////////////////////////////////////////////
function editAddEmployee()
{
	var tab = document.getElementById("tab_list_emp_item");
	removeEditRow(TABLE_ROW_EDIT_ID);
	var newRow = tab.insertRow(1);
	newRow.id = TABLE_ROW_EDIT_ID;
	var cell = newRow.insertCell();
	cell.colSpan = (tab.rows[0]).cells.length;
	var aGender = new Array();
	var mJson = {"text":getLanTextByKey("MALE_TITLE"),"val":0,"posX":-196,"posY":-133,"modifyPosX":-196,"modifyPosY":-115};
	var fJson = {"text":getLanTextByKey("FEMALE_TITLE"),"val":1,"posX":-213,"posY":-133,"modifyPosX":-213,"modifyPosY":-115};
	aGender.push(mJson);	
	aGender.push(fJson);	
	
	var aAdmin = new Array();
	var mJson = {"text":getLanTextByKey("T_ADMIN"),"val":1,"posX":-244,"posY":-133,"modifyPosX":-244,"modifyPosY":-115};
	var gJson = {"text":getLanTextByKey("GENERAL_EMP_TITLE"),"val":0,"posX":-229,"posY":-133,"modifyPosX":-229,"modifyPosY":-115};
	aAdmin.push(mJson);	
	aAdmin.push(gJson);	
	
	var jsons = [{"name":getLanTextByKey("T_NAME"),"tips":getLanTextByKey("PLS_INPUT_USER_NAME_DESC"),"value":"","id":"txt_emp_name","type":0,"data":null,"maxlen":100,"error":getLanTextByKey("T_ONLY_ACCEPT_UNIT_TIPS").replace("%1","100")},
								{"name":getLanTextByKey("T_CODE"),"tips":getLanTextByKey("PLS_INPUT_USER_CODE_DESC"),"value":"","id":"txt_emp_code","type":0,"data":null,"maxlen":20,"error":getLanTextByKey("T_ONLY_ACCEPT_UNIT_TIPS").replace("%1","20")},
								{"name":getLanTextByKey("T_PWD"),"tips":"","value":"","id":"txt_emp_pwd","type":1,"data":null,"maxlen":6,"error":getLanTextByKey("T_ONLY_ACCEPT_NUMBER_TIPS").replace("%1","6")},
								{"name":getLanTextByKey("GENDER_TITLE"),"tips":"","value":"","id":"txt_emp_gender","type":1,"data":initSelectObj("div_select_gender",aGender,false,"")},
								{"name":getLanTextByKey("EMP_TYPE_TITLE"),"tips":"","value":"","id":"txt_emp_type","type":1,"data":initSelectObj("div_select_emp_type",aAdmin,false,"")}];//,{"name":"IP","tips":"请输入设备IP","value":"192.168.0.1"}
	initEditRowUI(cell,jsons,"AddEmployee", null);
	setTimeout(function(){
		resizeEditRowSelectMenuPos();
		resizeSearchObj("a_add_emp","emp_search");
	},0);
}
function AddEmployee()
{
	var item = new Object();
	var empObj = document.getElementById("txt_emp_name");
	var codeObj = document.getElementById("txt_emp_code");
	item.szName = (empObj.value == empObj.tips)?"":empObj.value;
	item.szCode = (codeObj.value == codeObj.tips)?"":codeObj.value;
	item.szPwd = document.getElementById("txt_emp_pwd").value;
	item.dwGender = (document.getElementById("div_select_gender_item_0").val)?1:0;
	item.isAdmin = (document.getElementById("div_select_emp_type_item_0").val == 1)?128:1;
	//为了简化代码，使用固定字串做为参数。
	var ret = _externalAddEmployee('onAddEmployee', item.szName, item.szCode, item.dwGender/*0表男性，1表女性*/, item.szPwd/*密码要么不设，要么是6位数字*/, item.isAdmin/*0表普通人员。128表示管理员*/);
	eval ('var err = ' + ret);
	//err.nCode 错误码。大于等于0时表示无错误szMsg成员无效。小于0时表示出错。
	//err.szMsg 当出错时该成员才有效，包含错误的文本信息。
	if (err.nCode >= 0)
	{
		//此处应禁用所有按钮，只允许取消按钮可以操作
		startProcess(1,null);
		return 0;
	}
	cancelProcess();
	alert(err.szMsg);
}

function onAddEmployee(szRet)
{
	eval('var err = ' + szRet);
	//err.nCode 错误码。大于等于0时表示无错误且为设备的ID号。szMsg成员无效。小于0时表示出错。
	//err.szMsg 当出错时该成员才有效，包含错误的文本信息。
	//err.nID 人员在数据库中的ID号
	//err.szName 人员姓名
	//err.szCode 人员编号（工号）
	//err.dwGender 性别。0表示男，1表示女
	//err.szPwd 密码
	//err.dwFlag 属性标志。其中第7位置位表示为管理员。设置时应使用 (err.dwFlag | 128)，清除时应使用(err.dwFlag & ~128)
	
	//err.nDepartment 部门ID
	//err.szDepartment 部门名称
	//err.szBirthday 生日
	//err.szTitle 职位
	//err.szEducation 教育程度
	//err.szTel 电话
	//err.szAddress 家庭住址
	//err.szRemark 备注
	//err.szPhoto 照片
	//err.szCard 卡号
	//err.szExpiryTime 超期时间
	//err.szInfo1 附加信息1
	//err.szInfo2 附加信息2
	//err.szInfo3 附加信息3
	//err.szInfo4 附加信息4
	if (err.nCode < 0)
		alert(err.szMsg);
	else
		refreshPage();
	cancelProcess();
}
//删除人员代码////////////////////////////////////////////////////////////////////////////
function DelEmployee(btn)
{//alert(btn.hideContent);
	if(!confirm(getLanTextByKey("T_DEL_ITEM_TIPS")))
		return;
	var ret = _externalDelEmployee('onDelEmployee', (btn.hideContent).nID);
	eval ('var err = ' + ret);
	//err.nCode 错误码。大于等于0时表示无错误szMsg成员无效。小于0时表示出错。
	//err.szMsg 当出错时该成员才有效，包含错误的文本信息。
	if (err.nCode >= 0)
	{
		//此处应禁用所有按钮，只允许取消按钮可以操作
		startProcess(1,null);
		return 0;
	}
	alert(err.szMsg);
	cancelProcess();
}
function onDelEmployee(szRet)
{
	eval('var err = ' + szRet);
	//err.nCode 错误码。大于等于0时表示无错误且为设备的ID号。szMsg成员无效。小于0时表示出错。
	//err.szMsg 当出错时该成员才有效，包含错误的文本信息。
	if (err.nCode < 0)
		alert(err.szMsg);
	else
		refreshPage();
	cancelProcess();
}

