var curidku=0;
function AutoBalance()
{
	var url="AutoBalance.asp?id_ku="+curidku+"&d="+NewDate();
	var loader=new net.ContentLoader(url,handleBalance);
	if(curidku>=0)
	{
		window.setTimeout("AutoBalance();",120000);//2分钟运行一次
	}
}

function AutoCopyProduct()
{
	var url="AutoBalance.asp?act=copyproduct&id_ku="+curidku+"&d="+NewDate();
	var loader=new net.ContentLoader(url,handleBalance);
	if(curidku>=0)
	{
		window.setTimeout("AutoCopyProduct();",60000);//1分钟运行一次
	}
}

function handleBalance()
{
	if(this.req.readyState==4)
	{
		if(this.req.status==200)
		{
			var list=this.req.responseText;
			var lists=list.split("$$$");
			curidku=lists[0];
			var balance=getEle("balance");
			if(!isEmpty(balance))
			{
				if(balance.innerHTML!="End")
				{
				balance.innerHTML=lists[1];
				}
			}
		}
	}
}