function rssscroller()
{
	this.div=document.getElementById('rsshopper');
	var elements=this.div.getElementsByTagName('div');
	this.els=[];
	for(var i=0;i<elements.length;i++)
		this.els.push(elements[i].cloneNode(true));
	this.length=this.els.length;
	
	this.init();
}
$pr=rssscroller.prototype;
$pr.an=null;
$pr.height=205;
$pr.pos=1;

$pr.init=function()
{
	var obj=this;
	var method=this.scrollup;
	this.timer=setInterval(function(){method.apply(obj)},6000);
}
$pr.scrollup=function()
{
	this.doscroll(1);
}
$pr.scrolldown=function()
{
	this.doscroll(-1);
}
$pr.doscroll=function(dir)
{
	clearInterval(this.timer);
	
	// running the positions
	var mino=this.fix(this.pos-1);
	var maxo=this.fix(this.pos+1);
	
	// adding the elements;
	this.div.innerHTML='';
	this.div.appendChild(this.els[mino-1].cloneNode(true));
	this.div.appendChild(this.els[this.pos-1].cloneNode(true));
	this.div.appendChild(this.els[maxo-1].cloneNode(true));
	this.div.scrollTop=this.height;
	
	// running the positions
	this.pos=this.fix(this.pos+dir);
	
	// creating the animation
//	this.cancelan();
	var begin=this.div.scrollTop;
	var change=this.height*dir;
	var time=100;
	this.an=new phocus.Animator(null,null,begin,change,time,'inOutExpo');
	this.an.register(this,'scrollto');
	this.an.addListener(this,'init');
	this.an.round=true;
	this.an.run();
}
$pr.scrollto=function(y)
{
	this.div.scrollTop=y;
}
$pr.fix=function(pos)
{
	return pos<=0 ? this.length : (pos>this.length ? 1 : pos)
}
$pr.cancelan=function()
{
	this.an.kill();
}
$pr.toString=function()
{
	return 'SCROLLER: '+this.length+"\r\n"+this.pos;
}

rss_oldonload=window.onload;
window.onload=function()
{
	if(typeof rss_oldonload=='function')
		rss_oldonload();
	rss=new rssscroller();
}