﻿

LeadingMIS.UI = function(){}

LeadingMIS.UI.isWindow = function(eventWindow)
{
	if((typeof(eventWindow) == "object") && ("document" in eventWindow))
	{
		return true;
	}
	else
	{
		return false;
	}
}

LeadingMIS.UI.isObjectArray = function(tempObject)
{
	if((typeof(tempObject) == "object") && ("length" in tempObject))
	{
		return true;
	}
	else
	{
		return false;
	}
}

LeadingMIS.UI.insertEventHandler = function(objectElement,strEvent,strFunction)
{
	var E = /^[\s]*(void)?[\s]*function[^\(\)]*\(\)[\s]*{[\s]*([\s\S]*)[\s]*}[\s]*$/;
	if(typeof(objectElement) == "object")
	{
		if(strEvent in objectElement)
		{
			var s = "";
			s += ";" + strFunction;
			if(objectElement[strEvent] != null)
			{
				s += ";" + objectElement[strEvent].toString().replace(E,"$2");
			}
			try
			{
			//	s = s.replace(/this/g,"window.event.srcElement");
				eval("objectElement[strEvent]=function(){" + s + "}");
				return true;
			}
			catch(e)
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	else
	{
		return false;
	}
}

LeadingMIS.UI.addEventHandler = function(objectElement,strEvent,strFunction)
{
	var E = /^[\s]*(void)?[\s]*function[^\(\)]*\(\)[\s]*{[\s]*([\s\S]*)[\s]*}[\s]*$/;
	if(typeof(objectElement) == "object")
	{
		if(strEvent in objectElement)
		{
			var s = "";
			if(objectElement[strEvent] != null)
			{
				s += ";" + objectElement[strEvent].toString().replace(E,"$2");
			}
			s += ";" + strFunction;
			try
			{
				eval("objectElement[strEvent]=function(){" + s + "}");
				return true;
			}
			catch(e)
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	else
	{
		return false;
	}
}

LeadingMIS.UI.getObjectSource = function(tempObject)
{
	if(tempObject)
	{
		return this.getObjectSource(tempObject.parentElement) + "[" + tempObject.tagName + "]" + tempObject.id + ".";;
	}
	else
	{
		return "";
	}
}

LeadingMIS.UI.selectObject = function(tempObject)
{
	switch(tempObject.type.toLowerCase())
	{
		case "input":
			tempObject.focus();
			tempObject.select();
			break;
		case "select":
			tempObject.focus();
			break;
		case "hidden":
			break;
		case "text":
			tempObject.focus();
			tempObject.select();
			break;
		default:
			tempObject.focus();
			break;
	}
}

LeadingMIS.UI.showPopup = function(tempMessage,tempObject,eventWindow)
{
	eventWindow = (typeof(eventWindow) == "undefined")?window:eventWindow;
	try
	{
		var popup = eventWindow.createPopup();
		popup.document.body.style.border = "thin dotted #CCCCCC";
		popup.document.body.style.wordWrap = "break-word";
		popup.document.body.style.wordBreak = "normal";
		popup.document.body.style.cursor = "default";
		popup.document.body.style.font = "normal normal bolder smaller normal 新宋体";
		popup.document.body.innerHTML = tempMessage;
 		popup.show(tempObject.offsetLeft,tempObject.offsetTop + tempObject.offsetHeight,tempObject.offsetWidth,100,eventWindow.document.body);
 	}
	catch(e)
	{
		LeadingMIS.Error.setInfo(0,this.showPopup,"传入的参数[eventWindow]不是[window]对象","LeadingMIS.UI.showPopup","");
	}
}

LeadingMIS.UI.getAbsolute = function(objTemp)
{
	var left = 0;
	var top = 0;
	var obj = objTemp;
	while((obj != null) && (obj.tagName != "BODY"))
	{
		left += obj.offsetLeft;
		top += obj.offsetTop;
		obj = obj.parentElement;
	}
	return Array(left,top);
}

LeadingMIS.UI.formatValue = function(tempObject)
{
	if(typeof(tempObject.vType) != "undefined")
	{
		var tempValue = (typeof(tempObject.getValue) == "undefined")?(tempObject.value):(tempObject.getValue());
		if(tempValue.trim() != "")
		{
			switch(tempObject.vType.toLowerCase())
			{
				case "datetime"://DateTime
					if(typeof(tempObject.setValue) != "undefined")
					{
						tempObject.setValue(FormatDateTime(tempValue,0));
					}
					else
					{
						tempObject.value = FormatDateTime(tempValue,0);
					}
					break;
				case "date"://Date
					if(typeof(tempObject.setValue) != "undefined")
					{
						tempObject.setValue(FormatDateTime(tempValue,2));
					}
					else
					{
						tempObject.value = FormatDateTime(tempValue,2);
					}
					break;
				case "time"://Time
					if(typeof(tempObject.setValue) != "undefined")
					{
						tempObject.setValue(FormatDateTime(tempValue,3));
					}
					else
					{
						tempObject.value = FormatDateTime(tempValue,3);
					}
					break;
				case "int"://Int
				case "posint"://PosInt
				case "nonposint"://NonPosInt
				case "negint"://NegInt
				case "nonnegint"://NonNegInt
					if(typeof(tempObject.setValue) != "undefined")
					{
					//2007-1-31 zgl modify
						tempObject.setValue(parseInt(tempValue,10));
						//tempObject.setValue(tempValue);
					}
					else
					{
					//2007-1-31 zgl modify
						tempObject.value = parseInt(tempValue,10);
						//tempObject.value = tempValue;
					}
					break;
				case "decimal"://Decimal
				case "posdecimal"://PosDecimal
				case "nonposdecimal"://NonPosDecimal
				case "negdecimal"://NegDecimal
				case "nonnegdecimal"://NonNegDecimal
					if(typeof(tempObject.setValue) != "undefined")
					{
						tempObject.setValue(parseFloat(tempValue));
					}
					else
					{
						tempObject.value = parseFloat(tempValue);
					}
					break;
				default:
					break;
			}
		}
		else
		{
			;
		}
	}
	else
	{
		;
	}
}
//--------------------------------------------------------------------------------------------------------------
//-- 功能：全选或全不选
//-- 参数：sObj：源对象		dObj：目标对象
//-- 说明：查询列表页面首列列出带主键值的CheckBox需要这个功能
//-- 例如：<input id='Check_PHA051122000029'  class='inputcheckbox' type='checkbox' name='ActionPZ' value='PHA051122000029' >
//-- 作者：黄岳
//--------------------------------------------------------------------------------------------------------------

LeadingMIS.UI.selChk = function (obj, strName){
	try{
		var chkArray = document.getElementsByName(strName);
		for(var i=0;i<chkArray.length;i++)
		{
			if(chkArray[i].type == "checkbox" && chkArray[i].disabled==false){
				chkArray[i].checked = obj.checked;
			}
		}
	}
	catch(e){
		alert(e)
	}
}

/****************************************************
名称:LeadingMIS.UI.selAllChk(strName,eventWindow)
作者:刘晖
类型:Public
参数:输入		strName			string		checkbox的name
				eventWindow		window		当前也的window对象
     输出
说明:全选checkbox组
继承:LeadingMIS.UI.selChk(obj,strName)
	 LeadingMIS.UI.selAllChk1(strName)
示例:
LeadingMIS.UI.selAllChk("chk");
LeadingMIS.UI.selAllChk("chk",window);
****************************************************/
LeadingMIS.UI.selAllChk = function(strName,eventWindow)
{
	eventWindow = (typeof(eventWindow) == "undefined")?window:eventWindow;
	if(((eventWindow.event) != null) && ((eventWindow.event.srcElement) != null))
	{
		if(eventWindow.event.srcElement.type == "checkbox")
		{
			this.selChk(eventWindow.event.srcElement,strName);
		}
		else
		{
			this.selAllChk1(strName);
		}
	}
	else
	{
		this.selAllChk1(strName);
	}
}

//功能:	选中页面所有name=strName的CheckBox，用于列表的“全选”按钮
//注意: CheckBox的Name属性必须一致
//参数: strName:CheckBox的Name属性  
//返回： 
LeadingMIS.UI.selAllChk1 = function(strName)
{
	var chkArray = document.getElementsByName(strName);
    
	for(var i=0;i<chkArray.length;i++)
	{
		if(chkArray[i].disabled == false)
		{
			chkArray[i].checked = true;
		}
	}
}

//功能:	取消页面所有name=strName的CheckBox的选择，用于列表的“全不选”按钮
//注意: CheckBox的Name属性必须一致 
//参数: strName:CheckBox的Name属性  
//返回： 
LeadingMIS.UI.unselAllChk = function(strName)
{
	var chkArray = document.getElementsByName(strName);
    
	for(var i=0;i<chkArray.length;i++)
	{
		chkArray[i].checked = false;
	}
}

fnDelete = function()
{
	var strSent = GetSelectList();
	if(strSent==""){
		window.alert("您没有选择任何记录进行删除！");
		return ;
	}
	else{
		LeadingMIS.UI.ButtonList.Enabled(false);//不让点击 
		var arrID = strSent.split(",");
		if(window.confirm("您确实要删除这 " + arrID.length + " 条记录吗？")){
 			var strReturn =  Query.DeleteArray(strSent).value;
			if(strReturn==true){
				window.alert("删除成功！");
				document.location.href = document.location.href;
			}
			else{
				window.alert("删除过程中出现错误！");
			}
		}
		LeadingMIS.UI.ButtonList.Enabled(true);		
	}
}

fnDeleteTableRow = function(table,field)
{
	var strSent = GetSelectList();
	if(strSent==""){
		window.alert("您没有选择任何记录进行删除！");
		return ;
	}
	else{
		LeadingMIS.UI.ButtonList.Enabled(false);//不让点击 
		var arrID = strSent.split(",");
		if(window.confirm("您确实要删除这 " + arrID.length + " 条记录吗？")){
 			var strReturn =  Query.DeleteArrayTableRow(table, field, strSent).value;
			if(strReturn==true){
				window.alert("删除成功！");
				document.location.href = document.location.href;
			}
			else{
				window.alert("删除过程中出现错误！");
			}
		}
		LeadingMIS.UI.ButtonList.Enabled(true);		
	}
}

//功能:	确认用户是否进行删除操作
//注意: CheckBox的Name属性必须一致 
//参数: strName:CheckBox的Name属性  
//返回: 
LeadingMIS.UI.confirmDel = function(strName)
{
	var chkArray = document.getElementsByName(strName);
    var j = 0;
    var vConfirmDel = false;
	for(var i=0;i<chkArray.length;i++){
		if (chkArray[i].checked == true){
			j++;
		}
	}
	if(j>0){
		vConfirmDel = window.confirm("您确实要删除这 " + j + " 条记录吗？");
	}
	else{
		window.alert("您没有选择任何记录进行删除！");
		vConfirmDel = false;
	}
	return vConfirmDel;
}



//功能:	选择图标
//注意:  
//参数: VirtualPath 虚拟路径,NowFilePath 现在在的路径
//返回: 返回文件路径(站点的绝对路径)
LeadingMIS.UI.SelectImage = function(VirtualPath, NowFilePath)
{
	var tempWidth = 700;
	var tempHeight = 400;
	var strUrl = "/Common/Dialog/SelectImage/WebUI/FileList.aspx?VirtualPath=" + VirtualPath + "&NowFilePath=" + NowFilePath ;
	return window.showModalDialog(strUrl, null, "help=no;status=no;scroll=no;edge=raised;dialogHeight=" + (screen.height - tempHeight) + "px;dialogWidth=" + (screen.width - tempWidth) + "px;dialogLeft=" + (tempWidth / 2) + ";dialogTop=" + (tempHeight / 2) + ";");
}

//--------------------------------------------------------------------------------------------------------------
//-- 说明：取得单选框被选中的对象
//-- 参数：strRadioGroupName	对象名称
//-- 例如：var oCheck = getRadioChecked("edCheck");
//-- 作者：黄岳
//--------------------------------------------------------------------------------------------------------------
LeadingMIS.UI.getRadioChecked = function(strRadioGroupName)
{
	var chkArray = document.getElementsByName(strRadioGroupName);
	var oID = null
	for(var i=0;i<chkArray.length;i++)
	{
		if(chkArray[i].tagName=="INPUT" && chkArray[i].checked==true)
		{
			oID = chkArray[i];
			break;
		}
	}
	return oID ; 
}

//--------------------------------------------------------------------------------------------------------------
//-- 说明：取得复选框被选中的对象
//-- 参数：strCheckBoxName	对象名称
//-- 例如：var oCheckList = getCheckBoxChecked("edCheck");
//-- 作者：黄岳
//--------------------------------------------------------------------------------------------------------------
LeadingMIS.UI.getCheckBoxChecked = function(strCheckBoxName)
{
	var arrList = new Array();
	var chkArray = document.getElementsByTagName(strCheckBoxName);
	for(var i=0;i<chkArray.length;i++)
	{
		if(chkArray[i].checked==true)
		{
			arrList[arrList.length] = chkArray[i];
		}
	}
	return arrList;
}

//--------------------------------------------------------------------------------------------------------------
//-- 说明：set style of Radio and CheckBox 
//-- 参数：
//-- 例如：
//-- 作者：黄岳
//--------------------------------------------------------------------------------------------------------------
LeadingMIS.UI.setCheckBoxStyle = function()
{
	try{
		var chkArray = document.getElementsByTagName("INPUT");
		for(var i=0;i<chkArray.length;i++)
		{
			if(chkArray[i].type.toLowerCase()=="checkbox" ||  chkArray[i].type.toLowerCase()=="radio")
			{
				chkArray[i].className = "checkbox";
			}
		}
	}
	catch(e)
	{
		window.status = e.toString();
	}
}


/****************************************************
名称:LeadingMIS.UI.ShowCalendar(tempDate,tempSign,tempCh,tempFirst,tempStyle,tempObject,tempWidth,tempHeight,eventWindow)
作者:刘晖
类型:Public
参数:输入		tempDate		string		日期
				tempSign		char		选周(W)、选日(D)
				tempCh			char		显示农历(Y、N)
				tempFirst		string		周开始星期
				tempStyle		string		样式文件
				tempObject		object		日期控件对象
				tempWidth		string		对话框宽
				tempHeight		string		对话框高
				eventWindow		window		当前也的window对象
     输出						string		属性的相应值
说明:条用日期控件的方法
示例:
LeadingMIS.UI.ShowCalendar(tDate,"D","N","2","../style/blue.css",tempObj,"350","203",window);
LeadingMIS.UI.ShowCalendar(tDate,"D","N","2","../style/green.css",tempObj,"350","203",window);
****************************************************/
LeadingMIS.UI.ShowCalendar = function(tempDate,tempSign,tempCh,tempFirst,tempStyle,tempObject,tempWidth,tempHeight,eventWindow)
{
	eventWindow = (typeof(eventWindow) == "undefined")?window:eventWindow;
	
	var objectCalendar = new Object();
	var d = new Date();  
	var bakdate = d.getYear() + "-" + (d.getMonth()+1)  + "-" + d.getDate() ;
	objectCalendar.Date		= (typeof(tempDate) == "undefined" || tempDate=="" || vbIsDate(tempDate)==false) ? bakdate : tempDate;
	objectCalendar.Sign		= (typeof(tempSign) == "undefined")?"D":tempSign;
	objectCalendar.CH		= (typeof(tempCh) == "undefined")?"N":tempCh;
	objectCalendar.First	= (typeof(tempFirst) == "undefined")?"1":tempFirst;
	objectCalendar.Style	= (typeof(tempStyle) == "undefined")?"../style/blue.css":tempStyle;
	objectCalendar.Object	= (typeof(tempObject) == "undefined")?null:tempObject;
	
	var intWidth = (typeof(tempWidth) == "undefined")?"350":tempWidth;
	var intHeight = (typeof(tempHeight) == "undefined")?"203":tempHeight;
	
	try
	{
		var eventObject = eventWindow.document.createEventObject();
		var X = eventWindow.screen.width - eventObject.screenX;
		var Y = eventWindow.screen.height - eventObject.screenY;
		
		if((X >= intWidth) && (Y >= intHeight))
		{
			nLeft = eventObject.screenX;
			nTop = eventObject.screenY;
		}
		else if((X > intWidth) && (Y < intHeight))
		{
			nLeft = eventObject.screenX;
			nTop = eventObject.screenY - parseInt(intHeight);
		}
		else if((X < intWidth) && (Y > intHeight))
		{
			nLeft = eventObject.screenX - parseInt(intWidth);
			nTop = eventObject.screenY;
		}
		else 
		{
			nLeft = eventObject.screenX - parseInt(intWidth);
			nTop = eventObject.screenY - parseInt(intHeight);
		}
		return eventWindow.showModalDialog("/Common/Dialog/Calendar/WebUI/Calendar.htm",objectCalendar,"dialogLeft:" + nLeft + "px;dialogTop:" + nTop + "px;dialogWidth:" + intWidth + "px;dialogHeight:" + intHeight + "px;status:0;scroll:0;help:0");
	}
	catch(e)
	{
		LeadingMIS.Error.setInfo(0,this.ShowCalendar,"传入的参数[eventWindow]不是[window]对象","LeadingMIS.UI.ShowCalendar","");
		return null;
	}
}

/****************************************************
名称:LeadingMIS.UI.setDate(tempObj[,tempDate[,eventWindow]])
作者:刘晖
类型:Public
继承:LeadingMIS.UI.ShowCalendar(tempDate,tempSign,tempCh,tempFirst,tempStyle,tempObject,tempWidth,tempHeight,eventWindow)
参数:输入		tempObj		string		显示日期对象
				tempDate	string		默认日期
				eventWindow	window		当前也的window对象
     输出
说明:设置日期控件的方法
示例:
LeadingMIS.UI.setDate("UserCode2")
LeadingMIS.UI.setDate("UserCode2","2005-1-1")
LeadingMIS.UI.setDate("UserCode2","2005-1-1",window)
****************************************************/
LeadingMIS.UI.setDate = function(tempObj,tempDate,eventWindow)
{
	eventWindow = (typeof(eventWindow) == "undefined")?window:eventWindow;
	
	if((typeof(tempObj) == "object") && (tempObj.type == "text"))
	{
		var tDate = (typeof(tempDate) == "undefined" || tempDate == "")?tempObj.value:tempDate;
		if(LeadingMIS.ValueType.isDateTime(tDate) != true)
		{
			tDate = FormatDateTime(Now(),2);
		}
		tDate = this.ShowCalendar(tDate,"D","N","2","../style/blue.css",tempObj,"350","228",eventWindow);
		if(typeof(tDate) != "undefined")
		{
			tempObj.value = tDate;
		}
	}
}



//-----------------------------------------------------------------
//输入
//[SelectList]		默认选中的项
//[NonList]			从数据源中排除的项
//[isMultilist]		是否可多选

//输出objet 
//[ItemArray]		选中的全部项				--  二维数组[i][0]为ID，[i][1]为Name
//[InsertArray]		新添加的项					--  二维数组[i][0]为ID，[i][1]为Name
//[DeleteArray]		在默认选中项中删除的项		--  二维数组[i][0]为ID，[i][1]为Name
/*
	eg:
		var obj = LeadingMIS.UI.SelectRole("SR050224000042,SR050224000016","",false);
		if(typeof(obj) != "undefined" && obj!=null)//点击确定
		{
		   	var ItemArray= " ItemArray = " ;
		   	for(var i= 0 ; i<obj["ItemArray"].length;i++)
		   	{
		   		ItemArray += " - " + obj["ItemArray"][i][1];
		   	}
		   	var InsertArray= " InsertArray = " ;
		   	for(var i= 0 ; i<obj["InsertArray"].length;i++)
		   	{
		   		InsertArray += " - " + obj["InsertArray"][i][1];
		   	}
		   	var DeleteArray= " DeleteArray = " ;
		   	for(var i= 0 ; i<obj["DeleteArray"].length;i++)
		   	{
		   		DeleteArray += " - " + obj["DeleteArray"][i][1];
		   	}
			alert(ItemArray + InsertArray + DeleteArray)
		} 
*/
//mod hcl 2006-1-30 增加参数nType:0全部；1静态；2动态
//-----------------------------------------------------------------
LeadingMIS.UI.SelectRole = function(selectList, nonList, isMultilist, eventWindow, nType){
	eventWindow = (eventWindow == null)? window : eventWindow;
	eventWindow = (typeof(eventWindow) == "undefined")? window : eventWindow;
	var objectSelect = new Object();
	objectSelect["SelectList"]	= (typeof(selectList) == "undefined") ? "" : selectList;
	objectSelect["NonList"]		= (typeof(nonList) == "undefined") ? "" : nonList;
	objectSelect.isMultilist	= (typeof(isMultilist) == "undefined") ?  true : isMultilist;
	objectSelect.nType			= (typeof(nType) == "undefined") ?  "0" : nType;
	objectSelect.isShowCenter	=  true;
		
	try{
		var eventObject = eventWindow.document.createEventObject();
		var intWidth = 390;
		var intHeight = 418;
		var nLeft = 0;
		var nTop = 0;
		
		if(objectSelect.isShowCenter)												//居中显示
		{
			nLeft = (eventWindow.screen.availWidth - intWidth) / 2;
			nTop = (eventWindow.screen.availHeight - intHeight) / 2;
		}
		else																	//触发点显示
		{		
			var X = eventWindow.screen.width - eventObject.screenX;
			var Y = eventWindow.screen.height - eventObject.screenY;
			if((X >= intWidth) && (Y >= intHeight)){
				nLeft = eventObject.screenX;
				nTop = eventObject.screenY;
			}
			else if((X > intWidth) && (Y < intHeight)){
				nLeft = eventObject.screenX;
				nTop = eventObject.screenY - parseInt(intHeight);
			}
			else if((X < intWidth) && (Y > intHeight)){
				nLeft = eventObject.screenX - parseInt(intWidth);
				nTop = eventObject.screenY;
			}
			else{
				nLeft = eventObject.screenX - parseInt(intWidth);
				nTop = eventObject.screenY - parseInt(intHeight);
			}
		}

   		if (CheckIsSP2())
		{
			intHeight += 6;
		}		
		
		return eventWindow.showModalDialog("/Common/Dialog/SelectRole/WebUI/RoleList.aspx?t=" + new Date(),objectSelect,"dialogLeft:" + nLeft + "px;dialogTop:" + nTop + "px;dialogWidth:" + intWidth + "px;dialogHeight:" + intHeight + "px;status:0;scroll:0;help:0");
	}
	catch(e){
		LeadingMIS.Error.setInfo(0,this.SelectRole,"传入的参数[eventWindow]不是[window]对象","LeadingMIS.UI.SelectRole","");
		return null;
	}
}
/////////   SelectDepartment 
LeadingMIS.UI.SelectDepartment = function(selectList, nonList, isMultilist, eventWindow){
	eventWindow = (eventWindow == null)? window : eventWindow;
	eventWindow = (typeof(eventWindow) == "undefined")? window : eventWindow;
	var objectSelect = new Object();
	objectSelect["SelectList"]	= (typeof(selectList) == "undefined") ? "" : selectList;
	objectSelect["NonList"]		= (typeof(nonList) == "undefined") ? "" : nonList;
	objectSelect.isMultilist = (typeof(isMultilist) == "undefined") ?  true : isMultilist;
	objectSelect.isShowCenter = true;//暂时居中
	try{
		var eventObject = eventWindow.document.createEventObject();
		var intWidth = 390;
		var intHeight = 418;
		var nLeft = 0;
		var nTop = 0;
		
		if(objectSelect.isShowCenter)												//居中显示
		{
			nLeft = (eventWindow.screen.availWidth - intWidth) / 2;
			nTop = (eventWindow.screen.availHeight - intHeight) / 2;
		}
		else																	//触发点显示
		{		
			var X = eventWindow.screen.width - eventObject.screenX;
			var Y = eventWindow.screen.height - eventObject.screenY;
			if((X >= intWidth) && (Y >= intHeight)){
				nLeft = eventObject.screenX;
				nTop = eventObject.screenY;
			}
			else if((X > intWidth) && (Y < intHeight)){
				nLeft = eventObject.screenX;
				nTop = eventObject.screenY - parseInt(intHeight);
			}
			else if((X < intWidth) && (Y > intHeight)){
				nLeft = eventObject.screenX - parseInt(intWidth);
				nTop = eventObject.screenY;
			}
			else{
				nLeft = eventObject.screenX - parseInt(intWidth);
				nTop = eventObject.screenY - parseInt(intHeight);
			}
		}

   		if (CheckIsSP2())
		{
			intHeight += 6;
		}		
		
		return eventWindow.showModalDialog("/Common/Dialog/SelectDepartment/WebUI/DepartmentList.aspx?t=" + new Date(),objectSelect,"dialogLeft:" + nLeft + "px;dialogTop:" + nTop + "px;dialogWidth:" + intWidth + "px;dialogHeight:" + intHeight + "px;status:0;scroll:0;help:0");
	}
	catch(e){
		LeadingMIS.Error.setInfo(0,this.SelectRole,"传入的参数[eventWindow]不是[window]对象","LeadingMIS.UI.SelectDeparment","");
		return null;
	}	
}
	
	
// SelectPost  
LeadingMIS.UI.SelectPost = function(selectList, nonList, isMultilist, eventWindow){
	eventWindow = (eventWindow == null)? window : eventWindow;
	eventWindow = (typeof(eventWindow) == "undefined")? window : eventWindow;
	var objectSelect = new Object();
	objectSelect["SelectList"]	= (typeof(selectList) == "undefined") ? "" : selectList;
	objectSelect["NonList"]		= (typeof(nonList) == "undefined") ? "" : nonList;
	objectSelect.isMultilist = (typeof(isMultilist) == "undefined") ?  true : isMultilist;
	objectSelect.isShowCenter = true;
	
	try{
		var eventObject = eventWindow.document.createEventObject();
		var intWidth = 390;
		var intHeight = 418;
		var nLeft = 0;
		var nTop = 0;
		
		if(objectSelect.isShowCenter)												//居中显示
		{
			nLeft = (eventWindow.screen.availWidth - intWidth) / 2;
			nTop = (eventWindow.screen.availHeight - intHeight) / 2;
		}
		else																	//触发点显示
		{		
			var X = eventWindow.screen.width - eventObject.screenX;
			var Y = eventWindow.screen.height - eventObject.screenY;
			if((X >= intWidth) && (Y >= intHeight)){
				nLeft = eventObject.screenX;
				nTop = eventObject.screenY;
			}
			else if((X > intWidth) && (Y < intHeight)){
				nLeft = eventObject.screenX;
				nTop = eventObject.screenY - parseInt(intHeight);
			}
			else if((X < intWidth) && (Y > intHeight)){
				nLeft = eventObject.screenX - parseInt(intWidth);
				nTop = eventObject.screenY;
			}
			else{
				nLeft = eventObject.screenX - parseInt(intWidth);
				nTop = eventObject.screenY - parseInt(intHeight);
			}
		}

   		if (CheckIsSP2())
		{
			intHeight += 6;
		}		
		
		return eventWindow.showModalDialog("/Common/Dialog/SelectPost/WebUI/PostList.aspx?t=" + new Date(),objectSelect,"dialogLeft:" + nLeft + "px;dialogTop:" + nTop + "px;dialogWidth:" + intWidth + "px;dialogHeight:" + intHeight + "px;status:0;scroll:0;help:0");
	}
	catch(e){
		LeadingMIS.Error.setInfo(0,this.SelectRole,"传入的参数[eventWindow]不是[window]对象","LeadingMIS.UI.SelectRole","");
		return null;
	}
}

///SelectPerson
LeadingMIS.UI.SelectPersonOnly = function(selectList, nonList, isMultilist, eventWindow, RoleID) {    
    var objData = {}; //数据对象
    objData.isMultilist = isMultilist;
    objData.selectUserID = selectList;
    objData.nonUserID = nonList;
    objData.eventWindow = eventWindow;
    objData.isQual = true;
    objData.qualRoleID = RoleID;
    objData.isShowCenter = true;
    //objData.firstShow =2;
    return LeadingMIS.UI.SelectPersonLite(objData);
}

LeadingMIS.UI.SelectPersonLite = function(objData){

	if(typeof(objData) == "undefined" || !objData) objData = {};//数据对象

	var objDataTemp = { //默认值对象
		eventWindow				:	window,				//触发窗口;
		isMultilist				:	true,				//人是否可以多选;
		firstShow				:	0,					//第一个显示哪个TAB标签;
		isShowCenter			:	true,				//是否中间显示对话框;
		tabShowInfo				:	"1111",				//四个标签是否显示信息，1:显示,0:不显示。;
		
		selectUserID			:	"",					//选中的人员列表;
		nonUserID				:	"",					//不参与选择的列表;
		roleID					:	"",					//定位角色;
		roleType				:	"",					//角色类型，"":全部,0:静态,1:动态,.......等,根据数据情况而定;
		roleSysID				:	"",					//角色所属业务系统，"PM|OA|SF";
		
		postID					:	"",					//定位职务;
		postType				:	"",					//职务类型(暂无，将来扩展);
		deptID					:	"",					//定位部门，默认选中部门;
		deptType				:	"",					//部门类型，"":全部, 1:管理部门, 2:生产部门,.......等,根据数据情况而定;
		isDeptListSubItemUser	:	false,				//点击部门是否列出子部门的用户。;
 		
		isQual					:	false,				//否是显示资质列表;
		qualRoleID				:	"",					//资质列表对应的角色;
		disabledJoinProject		:	true,				//参与工程;
		disabledPersonQual		:	true				//人员资质;
	}
	
	//对数据对象进行默认值处理
	for(var strName in objDataTemp)
	{
		if(typeof(objData[strName]) == "undefined" || objData[strName] == null) 
		{
			objData[strName] = objDataTemp[strName];
		}
	}
	
 	try{
		
		var eventObject = objData.eventWindow.document.createEventObject();		//取得刚触发事件的对象
		
		var intWidth = 647;														//对话框宽度
		var intHeight = 421;	
		//402,width=647												//对话框高度
		var nLeft = 0;
		var nTop = 0;
		if(objData.isShowCenter)												//居中显示
		{
			nLeft = (objData.eventWindow.screen.availWidth - intWidth) / 2;
			nTop = (objData.eventWindow.screen.availHeight - intHeight) / 2;
		}
		else																	//触发点显示
		{		
			var X = objData.eventWindow.screen.width - eventObject.screenX;
			var Y = objData.eventWindow.screen.height - eventObject.screenY;
			if((X >= intWidth) && (Y >= intHeight)){
				nLeft = eventObject.screenX;
				nTop = eventObject.screenY;
			}
			else if((X > intWidth) && (Y < intHeight)){
				nLeft = eventObject.screenX;
				nTop = eventObject.screenY - parseInt(intHeight);
			}
			else if((X < intWidth) && (Y > intHeight)){
				nLeft = eventObject.screenX - parseInt(intWidth);
				nTop = eventObject.screenY;
			}
			else{
				nLeft = eventObject.screenX - parseInt(intWidth);
				nTop = eventObject.screenY - parseInt(intHeight);
			}
		}

   		if (CheckIsSP2())
		{
			intHeight += 6;
		}

		var strArri = "";
 		strArri += "&deptType=" + objData.deptType;
  		return objData.eventWindow.showModalDialog("/Common/Dialog/SelectPerson/WebUI/PersonListLite.aspx?t=" + new Date().getTime() + strArri , objData,"dialogLeft:" + nLeft + "px;dialogTop:" + nTop + "px;dialogWidth:" + intWidth + "px;dialogHeight:" + intHeight + "px;status:0;scroll:0;help:0");
	}
	catch(e){
		alert("LeadingMIS.UI.SelectPersonLite：" + e.Message);
	}
	return null;
}


LeadingMIS.UI.SelectPerson = function(selectList, nonList, isMultilist, eventWindow, RoleID ){

/*
	if(typeof(objData.eventWindow) == "undefined") objData.eventWindow = window;						//触发窗口
 	if(typeof(objData.isMultilist) == "undefined" ) objData.isMultilist = true;						//人是否可以多选
	if(typeof(objData.selectUserID) == "undefined" ) objData.selectUserID = "";						//选中的人员列表
	if(typeof(objData.nonUserID) == "undefined" ) objData.nonUserID = "";								//不参与选择的列表
	if(typeof(objData.isQual) == "undefined" ) objData.isQual = false;									//否是显示资质列表
	if(typeof(objData.qualRoleID) == "undefined" ) objData.qualRoleID = "";							//资质列表对应的角色

*/
	var objData = {};//数据对象
	objData.isMultilist = isMultilist;
	objData.selectUserID = selectList;
	objData.nonUserID = nonList;
	objData.eventWindow = eventWindow;
	objData.isQual = true;
	objData.qualRoleID = RoleID;
	objData.isShowCenter = true;
	//objData.firstShow =2;
	return LeadingMIS.UI.SelectPersonEx(objData);

	/*
	eventWindow = (eventWindow == null)? window : eventWindow;
	eventWindow = (typeof(eventWindow) == "undefined")? window : eventWindow;
	var objectSelect = new Object();
	objectSelect["SelectList"]	= (typeof(selectList) == "undefined") ? "" : selectList;
	objectSelect["NonList"]		= (typeof(nonList) == "undefined") ? "" : nonList;
	objectSelect.isMultilist = (typeof(isMultilist) == "undefined") ?  true : isMultilist;
	objectSelect["RoleID"]	= (typeof(RoleID) == "undefined") ? "" : RoleID;
	try{
		var eventObject = eventWindow.document.createEventObject();
		var intWidth = 560;
		var intHeight = 370;
		var nLeft = 0;
		var nTop = 0;
		var X = eventWindow.screen.width - eventObject.screenX;
		var Y = eventWindow.screen.height - eventObject.screenY;
		if((X >= intWidth) && (Y >= intHeight)){
			nLeft = eventObject.screenX;
			nTop = eventObject.screenY;
		}
		else if((X > intWidth) && (Y < intHeight)){
			nLeft = eventObject.screenX;
			nTop = eventObject.screenY - parseInt(intHeight);
		}
		else if((X < intWidth) && (Y > intHeight)){
			nLeft = eventObject.screenX - parseInt(intWidth);
			nTop = eventObject.screenY;
		}
		else{
			nLeft = eventObject.screenX - parseInt(intWidth);
			nTop = eventObject.screenY - parseInt(intHeight);
		}
		return eventWindow.showModalDialog("/Common/Dialog/SelectPerson/PersonList.aspx?t=" + new Date(),objectSelect,"dialogLeft:" + nLeft + "px;dialogTop:" + nTop + "px;dialogWidth:" + intWidth + "px;dialogHeight:" + intHeight + "px;status:0;scroll:0;help:0");
	}
	catch(e){
		LeadingMIS.Error.setInfo(0,this.SelectPerson,"传入的参数[eventWindow]不是[window]对象","LeadingMIS.UI.SelectPerson","");
		return null;
	}
	*/
}

//------------------------------------------------------------------------------
//-- 说明：LeadingMIS.UI.SelectPersonEx
/*
	 例子：
 		var objData = {};//数据对象
 		objData.isMultilist = true;				//人是否可以多选
		objData.firstShow = 0;					//默认显示哪个TAB标签，值：0:部门,1:职务,2:角色,3:高级查询
		objData.isShowCenter = false;			//是否屏幕中间显示对话框
		objData.tabShowInfo = "1111";			//四个标签是否显示信息，1:显示,0:不显示。
		objData.selectUserID = "";				//选中的人员列表
		objData.nonUserID = "";					//不参与选择的列表
		objData.roleID = "";					//定位角色
		objData.roleType = "";					//角色类型，"":全部,0:静态,1:动态,.......等,根据数据情况而定
		objData.roleSysID = "";					//角色所属业务系统，"PM|OA|SF"
		objData.postID = "";					//定位职务
		objData.postType = "";					//职务类型(暂无，将来扩展)
		objData.deptID = "";					//定位部门，默认选中部门
		objData.deptType = "";					//部门类型，"":全部, 1:管理部门, 2:生产部门,.......等,根据数据情况而定
		objData.isDeptListSubItemUser = false;	//点击部门是否列出子部门的用户。
		objData.isQual = false;					//否是显示资质列表
		objData.qualRoleID = "";				//资质列表对应的角色
		objData.eventWindow = window;			//触发窗口

		//需要要用的参数可以不写。

		var obj = LeadingMIS.UI.SelectPersonEx(obj);
		
		//返回值的数据结构
		// var obj = {
		//				ItemArray:	 [[UserID1, UserName1], [UserID2, UserName2]], 
		//				InsertArray: [[UserID1, UserName1], [UserID2, UserName2]],
		//				DeleteArray: [[UserID1, UserName1], [UserID2, UserName2]]
		//			}
		
		if(typeof(obj) != "undefined" && obj!=null)//点击确定
		{
  		   	var ItemArray= " ItemArray = " ;
		   	for(var i= 0 ; i<obj["ItemArray"].length;i++)
		   	{
		   		ItemArray += " - " + obj["ItemArray"][i][1];
		   	}
		   	var InsertArray= " InsertArray = " ;
		   	for(var i= 0 ; i<obj["InsertArray"].length;i++)
		   	{
		   		InsertArray += " - " + obj["InsertArray"][i][1];
		   	}
		   	var DeleteArray= " DeleteArray = " ;
		   	for(var i= 0 ; i<obj["DeleteArray"].length;i++)
		   	{
		   		DeleteArray += " - " + obj["DeleteArray"][i][1];
		   	}
			alert(ItemArray + InsertArray + DeleteArray)
		} 
		
*/
//------------------------------------------------------------------------------

LeadingMIS.UI.SelectPersonEx = function(objData){

	if(typeof(objData) == "undefined" || !objData) objData = {};//数据对象

	var objDataTemp = { //默认值对象
		eventWindow				:	window,				//触发窗口;
		isMultilist				:	true,				//人是否可以多选;
		firstShow				:	0,					//第一个显示哪个TAB标签;
		isShowCenter			:	true,				//是否中间显示对话框;
		tabShowInfo				:	"1111",				//四个标签是否显示信息，1:显示,0:不显示。;
		
		selectUserID			:	"",					//选中的人员列表;
		nonUserID				:	"",					//不参与选择的列表;
		roleID					:	"",					//定位角色;
		roleType				:	"",					//角色类型，"":全部,0:静态,1:动态,.......等,根据数据情况而定;
		roleSysID				:	"",					//角色所属业务系统，"PM|OA|SF";
		
		postID					:	"",					//定位职务;
		postType				:	"",					//职务类型(暂无，将来扩展);
		deptID					:	"",					//定位部门，默认选中部门;
		deptType				:	"",					//部门类型，"":全部, 1:管理部门, 2:生产部门,.......等,根据数据情况而定;
		isDeptListSubItemUser	:	false,				//点击部门是否列出子部门的用户。;
 		
		isQual					:	false,				//否是显示资质列表;
		qualRoleID				:	"",					//资质列表对应的角色;
		disabledJoinProject		:	true,				//参与工程;
		disabledPersonQual		:	true				//人员资质;
	}
	
	//对数据对象进行默认值处理
	for(var strName in objDataTemp)
	{
		if(typeof(objData[strName]) == "undefined" || objData[strName] == null) 
		{
			objData[strName] = objDataTemp[strName];
		}
	}
	
 	try{
		
		var eventObject = objData.eventWindow.document.createEventObject();		//取得刚触发事件的对象
		
		var intWidth = 647;														//对话框宽度
		var intHeight = 421;	
		//402,width=647												//对话框高度
		var nLeft = 0;
		var nTop = 0;
		if(objData.isShowCenter)												//居中显示
		{
			nLeft = (objData.eventWindow.screen.availWidth - intWidth) / 2;
			nTop = (objData.eventWindow.screen.availHeight - intHeight) / 2;
		}
		else																	//触发点显示
		{		
			var X = objData.eventWindow.screen.width - eventObject.screenX;
			var Y = objData.eventWindow.screen.height - eventObject.screenY;
			if((X >= intWidth) && (Y >= intHeight)){
				nLeft = eventObject.screenX;
				nTop = eventObject.screenY;
			}
			else if((X > intWidth) && (Y < intHeight)){
				nLeft = eventObject.screenX;
				nTop = eventObject.screenY - parseInt(intHeight);
			}
			else if((X < intWidth) && (Y > intHeight)){
				nLeft = eventObject.screenX - parseInt(intWidth);
				nTop = eventObject.screenY;
			}
			else{
				nLeft = eventObject.screenX - parseInt(intWidth);
				nTop = eventObject.screenY - parseInt(intHeight);
			}
		}

   		if (CheckIsSP2())
		{
			intHeight += 6;
		}

		var strArri = "";
 		strArri += "&deptType=" + objData.deptType;
  		return objData.eventWindow.showModalDialog("/Common/Dialog/SelectPerson/WebUI/PersonListEx.aspx?t=" + new Date().getTime() + strArri , objData,"dialogLeft:" + nLeft + "px;dialogTop:" + nTop + "px;dialogWidth:" + intWidth + "px;dialogHeight:" + intHeight + "px;status:0;scroll:0;help:0");
	}
	catch(e){
		alert("LeadingMIS.UI.SelectPersonEx：" + e.Message);
	}
	return null;
}

//	 SelectDepPos
//   create 2007.02.08 杜建龙
LeadingMIS.UI.SelectDepPos = function(selectList, nonList, isMultilist, eventWindow){
	eventWindow = (eventWindow == null)? window : eventWindow;
	eventWindow = (typeof(eventWindow) == "undefined")? window : eventWindow;
	var objectSelect = new Object();
	objectSelect["SelectList"]	= (typeof(selectList) == "undefined") ? "" : selectList;
	objectSelect["NonList"]		= (typeof(nonList) == "undefined") ? "" : nonList;
	objectSelect.isMultilist = (typeof(isMultilist) == "undefined") ?  true : isMultilist;
	objectSelect.isShowCenter = false;
	try{
		var eventObject = eventWindow.document.createEventObject();
		var intWidth = 390;
		var intHeight = 418;
		var nLeft = 0;
		var nTop = 0;
		
		if(objectSelect.isShowCenter)												//居中显示
		{
			nLeft = (eventWindow.screen.availWidth - intWidth) / 2;
			nTop = (eventWindow.screen.availHeight - intHeight) / 2;
		}
		else																	//触发点显示
		{		
			var X = eventWindow.screen.width - eventObject.screenX;
			var Y = eventWindow.screen.height - eventObject.screenY;
			if((X >= intWidth) && (Y >= intHeight)){
				nLeft = eventObject.screenX;
				nTop = eventObject.screenY;
			}
			else if((X > intWidth) && (Y < intHeight)){
				nLeft = eventObject.screenX;
				nTop = eventObject.screenY - parseInt(intHeight);
			}
			else if((X < intWidth) && (Y > intHeight)){
				nLeft = eventObject.screenX - parseInt(intWidth);
				nTop = eventObject.screenY;
			}
			else{
				nLeft = eventObject.screenX - parseInt(intWidth);
				nTop = eventObject.screenY - parseInt(intHeight);
			}
		}

   		if (CheckIsSP2())
		{
			intHeight += 6;
		}		
		
		return eventWindow.showModalDialog("/Common/Dialog/SelectDepPos/WebUI/DepPosList.aspx?t=" + new Date(),objectSelect,"dialogLeft:" + nLeft + "px;dialogTop:" + nTop + "px;dialogWidth:" + intWidth + "px;dialogHeight:" + intHeight + "px;status:0;scroll:0;help:0");
	}
	catch(e){
		LeadingMIS.Error.setInfo(0,this.SelectRole,"传入的参数[eventWindow]不是[window]对象","LeadingMIS.UI.SelectRole","");
		return null;
	}
}
//-----------------------------------------------------------------
//--- 说明： 发布到模块的页面接口
//-----------------------------------------------------------------
LeadingMIS.UI.ReleaseToModule = function(ModuleName, ModuleURL, ModuleRightCodes)
{
	var strUrl = "/SysFrames/ModuleManage/WebUI/AddModule.aspx";
	strUrl += "?ModuleName=" + ModuleName;
	strUrl += "&ModuleURL=" + escape(ModuleURL);
	strUrl += "&ModuleRightCodes=" + ModuleRightCodes;
	return window.showModalDialog( strUrl ,"添加新模块","dialogWidth:600px;dialogHeight:400px;help=no;status=no;scroll=no;");
}


//-----------------------------------------------------------------
//--- 说明： 选择权限的页面接口
//-----------------------------------------------------------------
LeadingMIS.UI.SelectRight = function(RightCodes)
{
	var tempWidth = 350;
	var tempHeight = 500;
	var t = "t=" + (new Date()).getTime() + "&";
	var strUrl = "/Common/Dialog/SelectRight/WebUI/SelectRightTree.aspx?" + t + "RightCode=" + RightCodes ;
	return  window.showModalDialog(strUrl, 
	"选择权限", 
	"help=no;status=no;scroll=no;edge=raised;dialogHeight=" + tempHeight + "px;dialogWidth=" + tempWidth + "px;");
	
}


//-----------------------------------------------------------------
//--- 说明： 选择权限的页面接口
//-----------------------------------------------------------------
LeadingMIS.UI.SelectModule = function( ModuleID )
{
	var tempWidth = 400;
	var tempHeight = 450;
	var obj = {"ID": ModuleID}
	var t = "t=" + (new Date()).getTime() + "&";
	var strUrl = "/Common/Dialog/SelectModule/WebUI/SelectModule.aspx?" + t ;
	return  window.showModalDialog(strUrl, 
	obj, 
	"help=no;status=no;scroll=no;edge=raised;dialogHeight=" + tempHeight + "px;dialogWidth=" + tempWidth + "px;");
	
}


//-----------------------------------------------------------------
	
//--------------------------------------------------------------------------------------------------------------
//-- 功能：读取数据时显示进度条（模拟版）
//-- 参数：Caption：Load条显示的内容		Title：Load条显示的标题
//-- 方法： show()     显示进度条
//--		close()    关闭进度条
//--		Create()   创建文本，加入到document
//-- 例子：	var myLoad=new LoadingClass(); 
//--		var myLoad=new LoadingClass("正是读取数据...");  
//--		var myLoad=new LoadingClass("正是读取数据...", "数据读取中,请稍候...");  
//--		myLoad.show();		//打开并显示
//			myLoad.close();     //关闭
//			delete myLoad;
//-- 作者：黄岳
//--------------------------------------------------------------------------------------------------------------

LeadingMIS.UI.LoadingClass = function(Caption, Title, bImage){
	this.objID = "IsLoading";
	this.strImg = "/Skins/Default/Images/Loading.gif";
	this.strCaption  = (Caption == null) ? "Loading..." : Caption;		//Load条显示的内容
	this.strTitle = (Title == null) ? "正在取得数据,请稍候..." : Title;	//Load条显示的标题
	this.strContainer = document.getElementsByTagName("TD");
	this.bShowImage = (bImage==null) ? true : bImage;
	this.IsLoad = false;
	this.Create = function(){
		var LoadDiv = window.document.all.item(this.objID,0);
		while (LoadDiv=="[object]"){
			window.document.body.removeChild(LoadDiv);
			LoadDiv = window.document.all.item(this.objID,0);
		}
		var objDiv = window.document.createElement("<div id='" + this.objID + "' style='POSITION:absolute;z-index:200;LEFT:0px;TOP:0px;WIDTH:100%;HEIGHT:100%;DISPLAY:none;'  oncontextmenu='return false' />");
		objDiv.setCapture(true);
		var strHTML = "<table border='0' width='100%' height='100%'>";
			strHTML += "	<tr>";
			strHTML += "		<td>";
			strHTML += "			<table align='center' valign='middle' height='40' width='100' border='0' title='" + this.strTitle + "'  style='cursor:hand;' ondblClick=\"document.all.item('" + this.objID + "',0).style.display = 'none';\">";
			strHTML += "				<tr>";
			strHTML += "					<td align='center' nowrap id='LoadingClass_Caption'><b>" + this.strCaption + "</b></td>";
			strHTML += "				</tr>";
			if(this.bShowImage)
			{
				strHTML += "				<tr>";
				strHTML += "					<td align='center'><img src='" + this.strImg + "'></td>";
				strHTML += "				</tr>";
			}
			strHTML += "			</table>";
			strHTML += "		</td>";
			strHTML += "	</tr>";
			strHTML += "</table>";
		objDiv.innerHTML = strHTML;
		window.document.body.insertAdjacentElement("afterBegin",objDiv);
	}
	this.show = function (){
		if(this.IsLoad == false){
			this.Create();
			this.IsLoad = true;
		}
		var LoadDiv = window.document.all.item(this.objID,0);
		if (LoadDiv=="[object]"){
			LoadDiv.style.display = "block" ;
		}
	}
	this.close = function(){
		var LoadDiv = window.document.all.item(this.objID,0);
		if (LoadDiv=="[object]"){
			LoadDiv.style.display = "none" ;
		}
	}
	this.ChangeCaption = function(strLoadCaption,fontColor){
		var oLoadTitle = window.document.all.item("LoadingClass_Caption",0);
		if (oLoadTitle=="[object]")
		{
			oLoadTitle.firstChild.innerText = strLoadCaption;
			if(fontColor != null)
			{
				oLoadTitle.style.color = fontColor;
			}
			else
			{
				oLoadTitle.style.color = "";
			}
		}
	}	
}



/*
LeadingMIS.UI.CommonSelectDialog = function(tempType,tempSign,tempSelectID,tempTilteL,tempTilteR,tempTilte,tempQuery,tempHeight,tempWidth,eventWindow)
{
	if(typeof(tempType) == "undefined")
	{
		return null;
	}
	eventWindow = (typeof(eventWindow) == "undefined")?window:eventWindow;
	
	tempSign = (typeof(tempSign) == "undefined")?"1":tempSign;
	tempSelectID = (typeof(tempSelectID) == "undefined")?"":tempSelectID;
	tempTilteL = (typeof(tempTilteL) == "undefined")?"待选":tempTilteL;
	tempTilteR = (typeof(tempTilteR) == "undefined")?"已选":tempTilteR;
	tempTilte = (typeof(tempTilte) == "undefined")?"选择框":tempTilte;
	tempQuery = (typeof(tempQuery) == "undefined")?"":tempQuery;
	tempHeight = (typeof(tempHeight) == "undefined")?"600":tempHeight;
	tempWidth = (typeof(tempWidth) == "undefined")?"300":tempWidth;
	
	try
	{
		return eventWindow.showModalDialog("/SysFrames/UserControl/CommonSelectDialog/WebUI/CommonBackstair.aspx?type=" + tempType + "&sign=" + tempSign + "&selected=" + tempSelectID + "&tilteL=" + tempTilteL + "&tilteR=" + tempTilteR + "&tilte=" + tempTilte + "&query=" + tempQuery,null,"help=no;status=no;scroll=no;edge=raised;dialogHeight=" + (screen.height - tempHeight) + "px;dialogWidth=" + (screen.width - tempWidth) + "px;dialogLeft=" + (tempWidth / 2) + ";dialogTop=" + (tempHeight / 2) + ";");
	}
	catch(e)
	{
		LeadingMIS.Error.setInfo(0,this.CommonSelectDialog,"传入的参数[eventWindow]不是[window]对象","LeadingMIS.UI.CommonSelectDialog","");
		return null;
	}
}


LeadingMIS.UI.CommonDuty = function(tempSelectID,tempQuery,eventWindow)
{
	eventWindow = (typeof(eventWindow) == "undefined")?window:eventWindow;
	return this.CommonSelectDialog("selectDuty","1",tempSelectID,"待选职务","已选职务","职务选择框",tempQuery,400,500,eventWindow);
}

LeadingMIS.UI.CommonPerson = function(tempSelectID,tempQuery,eventWindow)
{
	eventWindow = (typeof(eventWindow) == "undefined")?window:eventWindow;
	return this.CommonSelectDialog("selectPerson","1",tempSelectID,"待选人员","已选人员","人员选择框",tempQuery,400,500,eventWindow);
}

//名称:
//作用:选择部门桌面
//传入参数: 桌面地址引用
LeadingMIS.UI.SelectDepartmentDesktop = function (strUrl)
{
	nLeft=event.screenX+10;
	nTop=event.screenY+10;
	//window.open("http://"+window.location.host + "/Common/Dialog/SelectDeptDesktop/WebUI/DeptDesktopSelect.aspx?PageUrl=aa");
	strReturn=window.showModalDialog("http://" +window.location.host + "/Common/Dialog/SelectDeptDesktop/WebUI/DeptDesktopSelect.aspx?PageUrl=" +escape(strUrl) ,"", "dialogLeft:" + nLeft + ";dialogTop:" + nTop + ";dialogWidth:250px;dialogHeight:300px;status:0;scroll:0;help:0");							
	return strReturn;
}

LeadingMIS.UI.SelectUserDialog = function(selectList,nonList,tempWidth,tempHeight,eventWindow)
{
	eventWindow = (typeof(eventWindow) == "undefined")?window:eventWindow;
	//[SelectList]		默认选中的项
	//[NonList]			从数据源中排除的项
	var objectSelect = new Object();
	objectSelect["SelectList"]	= (typeof(selectList) == "undefined")?"":selectList;
	objectSelect["NonList"]		= (typeof(nonList) == "undefined")?"":nonList;
	
	var intWidth = (typeof(tempWidth) == "undefined")?"350":tempWidth;
	var intHeight = (typeof(tempHeight) == "undefined")?"203":tempHeight;
	//debugger;
	try
	{
		var eventObject = eventWindow.document.createEventObject();
		var X = eventWindow.screen.width - eventObject.screenX;
		var Y = eventWindow.screen.height - eventObject.screenY;
		
		if((X >= intWidth) && (Y >= intHeight))
		{
			nLeft = eventObject.screenX;
			nTop = eventObject.screenY;
		}
		else if((X > intWidth) && (Y < intHeight))
		{
			nLeft = eventObject.screenX;
			nTop = eventObject.screenY - parseInt(intHeight);
		}
		else if((X < intWidth) && (Y > intHeight))
		{
			nLeft = eventObject.screenX - parseInt(intWidth);
			nTop = eventObject.screenY;
		}
		else //((X < intWidth) && (Y < intHeight))
		{
			nLeft = eventObject.screenX - parseInt(intWidth);
			nTop = eventObject.screenY - parseInt(intHeight);
		}
		return eventWindow.showModalDialog("/Common/Dialog/Select/SelectDialog1.aspx",objectSelect,"dialogLeft:" + nLeft + "px;dialogTop:" + nTop + "px;dialogWidth:" + intWidth + "px;dialogHeight:" + intHeight + "px;status:0;scroll:0;help:0");
	}
	catch(e)
	{
		LeadingMIS.Error.setInfo(0,this.SelectUserDialog,"传入的参数[eventWindow]不是[window]对象","LeadingMIS.UI.ShowCalendar","");
		return null;
	}
}


//////////////////////
LeadingMIS.UI.SelectUserDialog1 = function(selectList,nonList,tempWidth,tempHeight,eventWindow)
{
	eventWindow = (typeof(eventWindow) == "undefined")?window:eventWindow;
	//[SelectList]		默认选中的项
	//[NonList]			从数据源中排除的项
	var objectSelect = new Object();
	objectSelect["SelectList"]	= (typeof(selectList) == "undefined")?"":selectList;
	objectSelect["NonList"]		= (typeof(nonList) == "undefined")?"":nonList;
	
	var intWidth = (typeof(tempWidth) == "undefined")?"350":tempWidth;
	var intHeight = (typeof(tempHeight) == "undefined")?"203":tempHeight;
	//debugger;
	try
	{
		var eventObject = eventWindow.document.createEventObject();
		var X = eventWindow.screen.width - eventObject.screenX;
		var Y = eventWindow.screen.height - eventObject.screenY;
		
		if((X >= intWidth) && (Y >= intHeight))
		{
			nLeft = eventObject.screenX;
			nTop = eventObject.screenY;
		}
		else if((X > intWidth) && (Y < intHeight))
		{
			nLeft = eventObject.screenX;
			nTop = eventObject.screenY - parseInt(intHeight);
		}
		else if((X < intWidth) && (Y > intHeight))
		{
			nLeft = eventObject.screenX - parseInt(intWidth);
			nTop = eventObject.screenY;
		}
		else //((X < intWidth) && (Y < intHeight))
		{
			nLeft = eventObject.screenX - parseInt(intWidth);
			nTop = eventObject.screenY - parseInt(intHeight);
		}
		return eventWindow.showModalDialog("/Common/Dialog/Select/SelectDialog3.aspx",objectSelect,"dialogLeft:" + nLeft + "px;dialogTop:" + nTop + "px;dialogWidth:" + intWidth + "px;dialogHeight:" + intHeight + "px;status:0;scroll:0;help:0");
	}
	catch(e)
	{
		LeadingMIS.Error.setInfo(0,this.SelectUserDialog,"传入的参数[eventWindow]不是[window]对象","LeadingMIS.UI.ShowCalendar","");
		return null;
	}
}

LeadingMIS.UI.UserDialogList = function(selectList,nonList,eventWindow)
{
	eventWindow = (typeof(eventWindow) == "undefined")?window:eventWindow;
//	return LeadingMIS.UI.SelectUserDialog(selectList,nonList,"450","275",eventWindow);
//  return LeadingMIS.UI.SelectUserDialog(selectList,nonList,"560","370",eventWindow);
	return LeadingMIS.UI.SelectUserDialog("selectList",nonList,"560","370",eventWindow);
	//return LeadingMIS.UI.SelectPerson("selectList", nonList, true, eventWindow)
	
}

///////////////
LeadingMIS.UI.UserDialogList1 = function(selectList,nonList,eventWindow)
{
	eventWindow = (typeof(eventWindow) == "undefined")?window:eventWindow;
//	return LeadingMIS.UI.SelectUserDialog(selectList,nonList,"450","275",eventWindow);
//  return LeadingMIS.UI.SelectUserDialog(selectList,nonList,"560","370",eventWindow);
	return LeadingMIS.UI.SelectUserDialog1("selectList",nonList,"385","370",eventWindow);
	//return LeadingMIS.UI.SelectPerson(selectList, nonList, true, eventWindow)

}
*/

