function Rolling() {
	this.name = "news";
	this.cindex = 0;
	this.item = new Array();
	this.itemname = "news";
	this.itemname_i = "news_i";
	this.itemcount = 0;
	this.item_i = new Array();
	this.item_icount = 0;
	this.pagecount	 = 1;
	this.changespeed = 1000;
	this.filter = 0;
	this.pausemouseover = true;
	this.stop = false;
	this.startpos	= 0;
	this.nowpos		= 0;
	
	this.add = function () {
		var text = arguments[0];
		this.item[this.itemcount] = text;
		this.itemcount = this.itemcount + 1;
	};

	this.addPhoto = function () {
		var text = arguments[0];
		this.item_i[this.item_icount] = text;
		this.item_icount = this.item_icount + 1;
	};

	this.display = function () {
		//list image rolling..
		if ( this.item_icount > 0 ) {
			var obj = document.getElementById( this.itemname_i );
			var divHTML = '<div id="'+this.itemname_i+'" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">';
			divHTML += this.item_i[this.cindex];
			divHTML +='</div>';
			obj.innerHTML = divHTML;
		}

		//list rolling..
		if ( this.itemcount > 0 ) {
			var obj = document.getElementById( this.itemname );
			var divHTML = '<div id="'+this.itemname+'" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">';
			var tstart	= this.startpos*this.pagecount;
			var tend	= tstart + this.pagecount;
			if ( tend >= this.itemcount ) {
				tstart = (this.itemcount-this.pagecount);
				tend   = tstart+this.pagecount;
			}

			for (i=tstart;i<tend;i++) {
				divHTML += this.item[i];
			}

			divHTML +='</div>';

			if(this.filter){
				obj.filters[0].apply();
				obj.innerHTML = divHTML;
				obj.filters[0].play();
			}else{
				obj.innerHTML = divHTML;
			} 
		}
	};

	this.start = function () {
		this.display();
		setTimeout(this.name+'.scroll()',this.changespeed);
	};

	this.scroll = function () {
		if ( this.stop == false ) {
		this.next();
		}
		window.setTimeout(this.name+".scroll()",this.changespeed);
	};

	this.next = function () {
		this.cindex++;
		if ( this.cindex >= this.item_icount ) {
		this.cindex = 0;
		}
		this.startpos = this.startpos + 1;
		this.nowpos = (this.itemcount / this.pagecount);
		if ( this.startpos >= this.nowpos ) {
		this.startpos = 0;
		}
		this.display();
	};

	this.prev = function () {
		this.cindex = this.cindex - 1;
		if ( this.cindex < 0 ) {
		this.cindex = this.item_icount - 1;
		}
		this.startpos = this.startpos - 1;
		if ( this.startpos < 0 ) {
		this.nowpos = (this.itemcount / this.pagecount);
		this.startpos = this.nowpos - 1;
		}
		this.display();
	};

	this.onmouseover = function () {
		if ( this.pausemouseover ) {
		this.stop = true;
		}
	};

	this.onmouseout = function () {
		if ( this.pausemouseover ) {
		this.stop = false;
		}
	};

	this.pos = function(){
		var pos = arguments[0];
		this.cindex = pos;
		this.nowpos = pos;
		this.startpos = pos;
		this.display();
	};
}
