var left = function(id){
try{document.execCommand("BackgroundImageCache", false, true);}catch(e){};
var container = document.getElementById(id),
original = container.getElementsByTagName("dt")[0],
clone = container.getElementsByTagName("dd")[0],
speed = arguments[1] || 40;
clone.innerHTML=original.innerHTML;
var rolling = function(){
if(container.scrollLeft == clone.offsetLeft){
container.scrollLeft = 0;
}else{
container.scrollLeft++;
}
}
var timer = setInterval(rolling,speed)//设置定时器
container.onmouseover=function() {clearInterval(timer)}//鼠标移到marquee上时，清除定时器，停止滚动
container.onmouseout=function() {timer=setInterval(rolling,speed)}//鼠标移开时重设定时器
document.getElementById('mqright').onmouseover=function() {clearInterval(timer);right("marquee");}
document.getElementById('mqleft').onmouseover=function() {clearInterval(timer);timer=setInterval(rolling,speed)}
 
}
var right = function(id){
	try{document.execCommand("BackgroundImageCache", false, true);}catch(e){};
	var container = document.getElementById(id),
	original = container.getElementsByTagName("dt")[0],
	clone = container.getElementsByTagName("dd")[0],
	speed = arguments[1] || 40;
	clone.innerHTML=original.innerHTML;
	var rolling = function(){
	if(container.scrollLeft == 0){
	container.scrollLeft = clone.offsetLeft;
	}else{
	container.scrollLeft--;
	}
	}
	var timer = setInterval(rolling,speed)//设置定时器
	container.onmouseover=function() {clearInterval(timer)}//鼠标移到marquee上时，清除定时器，停止滚动
	container.onmouseout=function() {timer=setInterval(rolling,speed)}//鼠标移开时重设定时器
document.getElementById('mqleft').onmouseover=function() {clearInterval(timer);left("marquee");}
document.getElementById('mqright').onmouseover=function() {clearInterval(timer);timer=setInterval(rolling,speed)}
}

