function gradient(id)
{
	var oId = document.getElementById(id);
	var tmp = 0;
	var autoGra = setInterval(function(){tmp+=10;oId.style.opacity=tmp*.01;oId.style.filter = 'alpha(opacity='+tmp+')';if(tmp>=100) clearInterval(autoGra)},10)
}
function gradientHd(id)
{
	var oId = document.getElementById(id)
	oId.style.opacity = 0;
	oId.style.filter = 'alpha(opacity=0)';
}
/*
Name:				ball changeTab
*/
function ballTab(ctrl,cntpre,cwrap)
{
	var exhIndex = 0;
	var autoBall = setInterval(changeTab,10000);
	var exhCtrls = document.getElementById(ctrl).getElementsByTagName('span');
	for (var i=0; i<exhCtrls.length; i++)
	{
		exhCtrls[i].onmouseover = function (i)
		{
			return function ()
			{
				if(i == exhIndex) return;
				exhCtrls[i].className = 'online_hs';
				exhCtrls[exhIndex].className = 'online_hs1';
				document.getElementById(cntpre+i).style.visibility = 'visible';
				gradient(cntpre+i);
				document.getElementById(cntpre+exhIndex).style.visibility = 'hidden';
				gradientHd(cntpre+exhIndex);
				exhIndex = i;
			}
		}(i)
	}
	document.getElementById(ctrl).onmouseover = document.getElementById(cwrap).onmouseover = function ()
	{
	    clearInterval(autoBall);
	}
	document.getElementById(ctrl).onmouseout = document.getElementById(cwrap).onmouseout = function ()
	{
		autoBall = setInterval(changeTab,10000);
	}
	function changeTab()
	{
		exhCtrls[exhIndex].className = 'online_hs1';
		exhCtrls[(exhIndex+1)%exhCtrls.length].className = 'online_hs';
		document.getElementById(cntpre+exhIndex).style.visibility = 'hidden';
		gradientHd(cntpre+exhIndex);
		document.getElementById(cntpre+(exhIndex+1)%exhCtrls.length).style.visibility = 'visible';
		gradient(cntpre+(exhIndex+1)%exhCtrls.length);
		exhIndex++;
		exhIndex%=exhCtrls.length;
	}
}

