function ScrollNews(){
	this.news = new Array();
	this.xid = "";
	this.time = 3000;
	var o = this;
	o.k = 0;
	o.timer;
	//开始
	this.start = function(){
		o.autoplay();
	}
	o.fid = function( id ){
		return document.getElementById( id );
	}
	//下一个
	this.next = function(){
		clearTimeout(o.timer);
		if( o.k > ( o.news.length-1 ) ){
			o.k = o.news.length-1;
		}
		o.autoplay();
	}
	//上一个
	this.pre = function(){
		clearTimeout(o.timer);
		if( o.k == 1 ){
			o.k = 0;
		} else {
			o.k = o.k-2;
		}
		o.autoplay();
	}
	//自动播放
	o.autoplay = function(){
		if( o.k > (o.news.length-1) ){
			o.k = 0;
		}
		o.fid( o.xid ).innerHTML = o.news[o.k];
		o.k++;
		o.timer = setTimeout( o.autoplay,o.time );
	}
}