function addEventSimple(obj,evt,fn){
	if(obj.addEventListener){
		obj.addEventListener(evt,fn,false);
	}else if(obj.attachEvent){
		obj.attachEvent('on'+evt,fn);
	}
}
addEventSimple(window,'load',initScrolling);
//保存想要滚动的容器
var scrollingBox;
var scrollingInterval;
//用于记录是否“滚到头”过一次
var reachedBottom=false;
//记录第一次滚到头时候的scrollTop
var bottom;
//初始化滚动效果
function initScrolling(){
	if(document.getElementById("picture-show"))
	{
	scrollingBox = document.getElementById("picture-show");
	//滚动
	scrollingInterval = setInterval("scrolling()",50);
	//鼠标划过停止滚动效果
	scrollingBox.onmouseover = over;
	//鼠标划出回复滚动效果
	scrollingBox.onmouseout = out;	
	}
}
//滚动效果
function scrolling(){
	//开始滚动,origin是原来scrollTop
	var origin = scrollingBox.scrollTop++;
	//如果到头了
	if(origin == scrollingBox.scrollTop){
		//如果是第一次到头
		if(!reachedBottom){
			scrollingBox.innerHTML+=scrollingBox.innerHTML;
			reachedBottom=true;
			bottom=origin;
		}else{
			//已经到头过，只需回复头接尾的效果
			scrollingBox.scrollTop=bottom;
		}
	}
}
function over(){
	clearInterval(scrollingInterval);
}
function out(){
	scrollingInterval = setInterval("scrolling()",50);
}
lastScrollY = 0;
function heartBeat(){ 
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
 diffY = document.documentElement.scrollTop;
else if (document.body)
 diffY = document.body.scrollTop
else{/*Netscape stuff*/}
percent=.1*(diffY-lastScrollY); 
if(percent>0)percent=Math.ceil(percent); 
else percent=Math.floor(percent); 
//document.getElementById("ad-left").style.top = parseInt(document.getElementById("qq-online").style.top)+percent+"px";
document.getElementById("qq-online").style.top = parseInt(document.getElementById("qq-online").style.top)+percent+"px";
lastScrollY=lastScrollY+percent;
}
//下面这段删除后，对联将不跟随屏幕而移动。
window.setInterval("heartBeat()",1);
function getXml() {
				return "<?xml version='1.0' encoding='utf-8'?><root><p u='flash/images/jd1.jpg' a='theme.htm' n='主题一'/><p u='flash/images/jd2.jpg' a='theme.htm' n='主题二'/><p u='flash/images/jd3.jpg' a='http://www.sese.com.cn/' n='主题三'/><p u='flash/images/jd4.jpg' a='theme.htm' n='主题四'/><p u='flash/images/jd5.jpg' a='theme.htm' n='主题五'/></root>";
			}