function barfocus(obj){
	obj.className = 'barfocus';
}

function barlostfocus(obj){
	obj.className = 'barlostfocus';
}

function barlostfocus1(obj){
	obj.className = 'barlostfocus1';
}

function bardofocus(obj){
	obj.className = 'bardofocus';
}

function popdialog(obj,h,w,url)
{
	//对话框
	var dialogconfig = 'dialogHeight:' + h + 'px;dialogWidth:' + w + 'px;help:no;status:no;center:yes;edge:sunken';	
    window.showModelessDialog(url,obj,dialogconfig);
}

//跳出新窗口
function popnewwin(windowname,h,w,url)
{
	var intTop = 0;
	var intLeft = 0;

	if (parseInt(h) == 8888 )
	{
	//如果高度为8888,那么全屏显示
		w=window.screen.availWidth-12;
		h=window.screen.availHeight-50;
	}
	else
	{//分辨率为800×600，从中间呈现
		intTop = (window.screen.availHeight-parseInt(h))/2;
		intLeft = (window.screen.availWidth-parseInt(w))/2;

		if (intTop < 30)
			intTop = 0;

		if (intLeft < 30)
			intLeft = 0;
	}
    var windowconfig = "titlebar=0,status=1,scrollbars=yes,top="+ intTop +",left="+ intLeft  +",resizable=1,width=" + w + ",height=" + h;


    subwin=window.open(url, windowname, windowconfig);
	if (subwin)
	{
		subwin.focus();
		return subwin;
		
	}
	   
}

function goPage(objTurnPage)
{

	if (document.forms('sysrequery')){
		if (isNaN(objTurnPage)){
			if (objTurnPage == 's'){
				document.forms('sysrequery').formpagenumber.value = 1;
			} else if (objTurnPage == 'e'){
				document.forms('sysrequery').formpagenumber.value = document.all('systotalpage').innerText;
			} else {
				document.forms('sysrequery').formpagenumber.value = document.all(objTurnPage).value;
			}
		}
		else
			document.forms('sysrequery').formpagenumber.value = parseInt(document.forms('sysrequery').formpagenumber.value) + 
															    parseInt(objTurnPage);
			
		document.forms('sysrequery').submit();
	}
}

var lastObjTR
function SysChangeRowColor(objTR)
{
    //选中DBGrid中的某行（即标识不同颜色），同时将原来选中的抹去
	
	if (lastObjTR)
	{
		lastObjTR.style.backgroundColor = '';
		/*
		for (td_idx = 0; td_idx < lastObjTR.cells.length; td_idx++)
		{
			objTD = lastObjTR.cells[td_idx]; //循环获得该行所有单元格对象
			//objTD.style.backgroundColor = '';
			
			for (obj_idx = 0; obj_idx < objTD.childNodes.length; obj_idx++)
			{
				obj = objTD.childNodes[obj_idx];
				if (obj.style)
				{
					obj.style.backgroundColor = '';
				}
				
			}

			
		}
		*/
	}
	if (objTR)
	{
		objTR.style.backgroundColor = '#EDEDED';
		//如果该行包括其他表单，那么将这些表单元素的背景颜色一并改为#FFF7E5
		/*
		for (td_idx = 0; td_idx < objTR.cells.length; td_idx++)
		{
			objTD = objTR.cells[td_idx]; //循环获得该行所有单元格对象
			//objTD.style.backgroundColor = '#EDEDED';
			
			for (obj_idx = 0; obj_idx < objTD.childNodes.length; obj_idx++)
			{
				obj = objTD.childNodes[obj_idx];
				if (obj.style)
				{
					obj.style.backgroundColor = '#EDEDED';
				}
				
			}
			
		}
		*/
		lastObjTR = objTR;
	}
}

function showMyLocation1(stitle){
	if (self.parent.banner.mylocation){	
		self.parent.banner.mylocation.innerText = stitle
	}
	
}

function showMyLocation2(stitle){
	if (self.parent.parent.banner.mylocation){	
		self.parent.parent.banner.mylocation.innerText = stitle
	}
	
}

function WriteCookie (cookieName, cookieValue, expiry) 
{
  var expDate = new Date();

  if(expiry){ //如果设置了cookie失效时间;
	 expDate.setTime (expDate.getTime() + expiry);
	 document.cookie = cookieName + "=" + escape (cookieValue) + "; expires=" + expDate.toGMTString();
  }
  else{ //没有设置cookie失效时间;
	 document.cookie = cookieName + "=" + escape (cookieValue); }
}

function ReadCookie (CookieName) {
  var CookieString = document.cookie;
  var CookieSet = CookieString.split (';');
  var SetSize = CookieSet.length;
  var CookiePieces
  var ReturnValue = "";
  var x = 0; 
  for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) {

	 CookiePieces = CookieSet[x].split ('=');

	 if (CookiePieces[0].substring (0,1) == ' ') {
		CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);}

	 if (CookiePieces[0] == CookieName) {
		ReturnValue = CookiePieces[1];}

  }
  return ReturnValue;
}
