<!--
	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;help: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;help: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;help: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;help: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;
}

 if (top.window.dialogHeight=='undefined') return;
 var Params  = windowParams.split(';');
 if (Params.length>=4)
 {
   if (Params[0]=='-1')
   {
     top.window.dialogHeight = screen.availHeight+'px';
     top.window.dialogWidth  = screen.availWidth+'px';
     top.window.dialogTop    = '0px';
     top.window.dialogLeft   = '0px';
   }
   else
   {
     if (parseInt(screen.availHeight)<parseInt(Params[1])) Params[1] = screen.availHeight;
     top.window.dialogHeight = Params[1]+'px';
     top.window.dialogWidth  = Params[0]+'px';
   }
   if ((Params[2]=='-1')||(Params[3]=='-1'))
   {
     top.window.dialogTop  = parseInt((screen.availHeight - parseInt(top.window.dialogHeight))/2)+'px';
     top.window.dialogLeft = parseInt((screen.availWidth - parseInt(top.window.dialogWidth))/2)+'px';
   }
   else
   {
     top.window.dialogTop = Params[3]+'px';
     top.window.dialogLeft = Params[2]+'px';
   }
 }
 
}

function checklen(str,len,syfj,btstr)
{
  //str--要检验的字符串，len--限定的长度，syfj--1为使用附件,btstr---字符串的显示名
  if(str.length > len)
  {
    var ts=btstr+'目前的字数为：'+str.length+'，超过限制长度：'+len+'，请删减部分文字';
    if(syfj=='1')
    {
      ts=ts+'，或选择使用附件';
    }
    alert(ts);
    return false;
  }
  return true;
}

function getcurrdt()
{   
    var today=new Date();
	var strYear = today.getYear();
	var strMonth = String(today.getMonth() + 1);
	var strDay = String(today.getDate());
	var strhh = String(today.getHours());
	var strmi=String(today.getMinutes());
	
	if (strMonth.length == 1)
	{
		strMonth ="0" + strMonth;
	}
	if (strDay.length == 1)
	{
		strDay = "0" + strDay;
	}
	if(strhh.length==1)
	{
	  strhh="0"+strhh;
	}
	if(strmi.length==1)
	{
	  strmi="0"+strmi;
	}

	return strYear + "-" + strMonth + "-" + strDay+' '+strhh+':'+strmi;
}


-->

