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+"'",10000);
	}
	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 = 'images/pop3_left2_1.gif';
	}
	else
	{
		document.getElementById('RollLink').innerHTML = '停止滚动播放';
		document.getElementById('RollImg').src = 'images/pop3_left2.gif';
	}
}



document.onkeydown=chang_page
function chang_page() 
{	
if (event.keyCode==37 )
{   
    location='http://www.pcpop.com/pp/194435_1120274.html#t';
}    
if (event.keyCode==39 )   
{
    location='http://www.pcpop.com/pp/194435_1120276.html#t';			
}
}
