<!--
	String.prototype.trim = function()
	{
		// 用正则表达式将前后空格
		// 用空字符串替代。
		return this.replace(/(^\s*)|(\s*$)/g, "");
	}

	function selectAll(selectButton, checkItem)
	{
		if (selectButton.checked == true)Values = 1;
		else Values = 0;
		for (i=0; i < checkItem.length; i++)
		{
			checkItem[i].checked=Values;
		}
	}

	function selectRev(checkItem)
	{
		for (i=0; i < checkItem.length; i++)
		{
			checkItem[i].checked=!checkItem[i].checked;
		}
	}

	function LstGpChecked (lstGp, lstVl)
	{
		for (i = 0; i < lstGp.length; i++)
		{
			var lstGpItem = lstGp[i].value;
			if (lstGpItem == lstVl)
			{
				lstGp[i].checked = true;
			}
		}	
	}

	function CheckRadioValue(radioItems)
	{
		for (i=0; i < radioItems.length; i++)
		{
			if (radioItems[i].checked == 1)return radioItems[i].value;
		}
	}

	function GetListControlValue(objLstCntl)
	{
		var lstvl = "";
		for (i=0; i < objLstCntl.length; i++)
		{
			if (objLstCntl[i].checked == 1)lstvl += objLstCntl[i].value + ",";
		}
		if (lstvl == "")return "";
		else 
		{
			return lstvl.substring(0, lstvl.length - 1);
		}
	}

	function showHideLayer(menuid)
	{
		if(menuid.style.display == "none"){
			menuid.style.display="";
		}
		else 
		{
			menuid.style.display="none";
		}
	}
	
	function fnModalDialog(page, width, height, fixpath, exparm)
	{	
		return window.showModalDialog(fixpath + "sdFm.aspx?page=" + page,window,"dialogWidth:" + width + "px;dialogHeight:" + height + "px;resizable:on;status:no;" + exparm);
	}
	
	function fnCfmDialog(page, width, height, fixpath, exparm)
	{
		return window.showModalDialog(fixpath + "CmFm.aspx?page=" + page,window,"dialogWidth:" + width + "px;dialogHeight:" + height + "px;resizable:on;status:no;" + exparm);
	}
	
	function fnModalLessDialog(page, width, height, fixpath, exparm)
	{
		return window.showModelessDialog(fixpath + "sdFm.aspx?page=" + page,window,"dialogWidth:" + width + "px;dialogHeight:" + height + "px;resizable:on;status:no;" + exparm);
	}
	
	function fnCfmLessDialog(page, width, height, fixpath, exparm)
	{
		return window.showModelessDialog(fixpath + "CmFm.aspx?page=" + page,window,"dialogWidth:" + width + "px;dialogHeight:" + height + "px;resizable:on;status:no;" + exparm);
	}

	function showHide(menuid, lookId)
	{
		if(menuid.style.display == "none"){
				menuid.style.display="";
				var point = fGetXY(lookId);
				menuid.style.left=point.x  ;
				menuid.style.top=point.y+lookId.offsetHeight;
		}
		else 
		{
			menuid.style.display="none";
		}
	}

	function subShowHide(menuid, methods)
	{
		menuid.style.display = methods;
	}

	function Point(iX, iY){
		this.x = iX;
		this.y = iY;
	}
	function fGetXY(aTag){
	  var oTmp = aTag;
	  var pt = new Point(0,0);
	  do {
		pt.x += oTmp.offsetLeft;
		pt.y += oTmp.offsetTop;
		oTmp = oTmp.offsetParent;
	  } while(oTmp.tagName!="BODY");

	  return pt;
	}

	function fnConcatFilter(strArrSource, strArrDest)
	{
		//	功能: 过滤两个字符串中相同的值（他们原来是数组,以逗号分隔,成为长字符串）;
		//	输入参数: strArrSource将被比较的源数据,strArrDest将要比较的目的数据;
		//	返回: 返回已过滤好的字符串;

		source = new String(strArrSource);
		dest = new String(strArrDest);
		if (source.length == 0)return dest;
		if (dest.length == 0)return source;
		var i = 0;s = 0;
		while (i != -1)
		{
			i = source.indexOf(",", i + 1);
			s++;
		}
		var i = 0;d = 0;
		while (i != -1)
		{
			i = dest.indexOf(",", i + 1);
			d++;
		}
		if (s > d)
		{
			dests = dest.split(",");
			return fnFilter(dests, source);
		}
		else
		{
			sources = source.split(",");
			return fnFilter(sources, dest);
		}
	}

	function fnFilter(arrShort, strLong)
	{
		for (var i = 0; i < arrShort.length; i++)
		{
			if (("," + strLong + ",").indexOf("," + arrShort[i] + ",") != -1)
			{
				//alert(arrShort[i])
				arrShort[i] = "";
			}
		}
		var filteStr = arrShort.toString() + "," + strLong;
		//alert(filteStr.replace(/,,/g, ",").replace(/(^,*)|(\,*$)/, ""))
		return filteStr.replace(/,,/g, ",").replace(/(^,*)|(\,*$)/, "");
	}

	var oPopup = window.createPopup();
	var runtimeColor;
	function PopupClick(targetObject, ShowText, rowCount, width, height, offsetLeft, offsetTop, filterStr)
	{
		var arrShowText = ShowText.split(",")
		var oPopBody = oPopup.document.body;
		oPopBody.style.backgroundColor = "white";
		oPopBody.style.border = "solid black 1px";
		var table= "<TABLE width=100% ><tr>"//<tr><td width=90% ></td><td rowspan=" + arrShowText.length + " width=10% ></td></tr>
		for (i = 0; i < arrShowText.length; i++)
		{
			table += "<TD  onmouseover='this.bgColor=\"#000066\";runtimeColor=this.children[0].style.color;this.children[0].style.color=\"#ffffff\"' onmouseout='this.bgColor=\"#ffffff\";this.children[0].style.color=runtimeColor'  onclick='parent.window.document.forms[0]." + targetObject.name + ".value = this.children[0].innerText.replace(\"" + filterStr + "\", \"\");parent.window.oPopup.hide()'><font color=black size=2>" + arrShowText[i] + "</font></TD>"
			if (( (i + 1) % rowCount ) == 0)
				table += "</TR><TR>"
		}
		table += "</TABLE>"
		oPopBody.innerHTML = table;
		oPopup.show(offsetLeft, offsetTop, width, height, targetObject);
	}


//ResizeModalWindow("300;200;1;1");
//功能: 在打开的窗口（模态）根据参数动态设置其大小和位置
function ResizeModalWindow(windowParams)
{//参数: 宽度;高度;左;上

	var parentWin = parent.location;
	var topWin = top.location;

	if (parentWin!=topWin)
	{
		return;
	}
//alert(windowParams);
	//if (top.window.dialogHeight=='undefined') return;
	//表单属性存在NULL的情况，需要处理
	if ( windowParams == null || windowParams == "" || windowParams.split(';').length < 4 )
	{
		windowParams = "800;600;-1;-1";
	}
	
	var Params  = windowParams.split(';');
	var vHeight = 800;
	var vWidth = 600;
	var vTop = 0;
	var vLeft =0;


	if (Params.length>=4)
	{
		if (Params[0]=='-1')
		{
			vHeight = screen.availHeight;
			vWidth  = screen.availWidth;
			vTop    = 0;
			vLeft   = 0;
		     
		}
		else
		{
			if (parseInt(screen.availHeight)<parseInt(Params[1])) Params[1] = screen.availHeight;
			vHeight = Params[1];
			vWidth  = Params[0];
		}
		   
		if ((Params[2]=='-1')||(Params[3]=='-1'))
		{
			vTop  = parseInt((screen.availHeight - parseInt(vHeight))/2);
			vLeft = parseInt((screen.availWidth - parseInt(vWidth))/2);
		}
		else
		{
			vTop = Params[3];
			vLeft = Params[2];
		}
		    
		//非模态
		if (typeof(top.window.dialogHeight)=='undefined')
		{//alert(vTop);
			top.window.resizeTo(vWidth,vHeight);
			top.window.moveTo(vLeft,vTop);
		}
		else
		{
				
			top.window.dialogHeight = vHeight+'px';
			top.window.dialogWidth  = vWidth+'px';
			top.window.dialogTop    = vTop+'px';
			top.window.dialogLeft   = vLeft+'px';
		     
		}
	}
 
}


-->


