var Set;
var DefaultRoll = false;//程序根据ChannelType输出默认是否循环
var IsRoll = true;
//试取Cookie中的值
var RollNum = 0;//0:强制不滚动 1:强制滚动  2:依照默认值
var CookieValue = readCookie('myRollCookie');
if (CookieValue == null || CookieValue.toString() == '')
{
	IsRoll = DefaultRoll;
}
else
{
	if (CookieValue.toString() == '1')
	{
		IsRoll = true;
	}
	else
	{
		IsRoll = false;
	}
}
function NextPage(NextImgUrl)
{
	if (IsRoll)
	{
		SetRoll(false);
		Set = setInterval("window.location.href='"+NextImgUrl+"'",5000);
	}
	else
	{
		SetRoll(true);
	}
}
function Clear(NextImgUrl)
{
	//alert(IsRoll);
	if (IsRoll)
	{
		clearInterval(Set);
		writeCookie('myRollCookie','0');
		SetRoll(true);
		IsRoll = false;
	}
	else
	{
		NextPage(NextImgUrl);
		writeCookie('myRollCookie','1');
		SetRoll(false);
		IsRoll = true;
		NextPage(NextImgUrl);
	}
}
function SetRoll(cRoll)
{
	if (cRoll)
	{
		document.getElementById('RollLink').innerHTML = '开始滚动播放';
		document.getElementById('RollImg').src = '/img/tuytx-2.gif';
	}
	else
	{
		document.getElementById('RollLink').innerHTML = '停止滚动播放';
		document.getElementById('RollImg').src = '/img/tuytx-2-1.gif';
	}
}