//=======================================================================================================================================
// 代码描述：实现DataGrid控件中，鼠标移到某一行时的背景色、字体色的设置，进行一些颜色交替变换 编写：chensheng
//=======================================================================================================================================
function QueryString(url,sName)
{
	var sSource = url;
	var sReturn = "";
	var sQUS = "?";
	var sAMP = "&";
	var sEQ = "=";
	var iPos;

	iPos = sSource.indexOf(sQUS);

	var strQuery = sSource.substr(iPos, sSource.length - iPos);
	var strLCQuery = strQuery.toLowerCase();
	var strLCName = sName.toLowerCase();

	iPos = strLCQuery.indexOf(sQUS + strLCName + sEQ);
	if (iPos == -1)
	{
		iPos = strLCQuery.indexOf(sAMP + strLCName + sEQ);
		if (iPos == -1)
		return "";
	}

	sReturn = strQuery.substr(iPos + sName.length + 2,strQuery.length-(iPos + sName.length + 2));
	var iPosAMP = sReturn.indexOf(sAMP);

	if (iPosAMP == -1)
		return sReturn;
	else
	{
		sReturn = sReturn.substr(0, iPosAMP);
	}

	return sReturn;
}
//==========================================================================================
// 代码描述：清除下拉菜单控件的所有数据   chensheng           2006/07/28           创建
//==========================================================================================
function DropDownClear(ctrl)
{
	var i;
	var len = ctrl.options.length;

	for (i=0; i< len; i++)
	{
		ctrl.options.remove(0);
	}
}
function MouseOut(obj)   
{   
	if(obj.style.backgroundColor=="#999999")
		obj.style.backgroundColor="#999999";
	else
	{
		obj.style.backgroundColor=obj.getAttribute('BKC');
		obj.style.backgroundColor='';
	}
	
} 
function MouseOver(obj)   
{   
	if(obj.style.backgroundColor=="#999999")
		obj.setAttribute('BKC',"#999999");
	else
	{
		obj.setAttribute('BKC',obj.style.backgroundColor);
		obj.style.backgroundColor='#B0EDFF';
	}
}
function OpenWindow(pageURL, innerWidth, innerHeight)
{	
	var ScreenWidth = screen.availWidth
	var ScreenHeight = screen.availHeight
	var StartX = (ScreenWidth - innerWidth) / 2
	var StartY = (ScreenHeight - innerHeight) / 2
	if(innerWidth==null&&innerHeight==null)
		window.open(pageURL)
	else
		window.open(pageURL, '', 'left='+ StartX + ', top='+ StartY + ', Width=' + innerWidth +', height=' + innerHeight + ', resizable=yes, scrollbars=yes, status=no, toolbar=no, menubar=no, location=no')
}
//==========================================================================================
// 代码描述：消除js代码产生的错误

//==========================================================================================
function killErrors(){return true;} 
window.onerror = killErrors; 
