ScrollRSS = Class.create();
ScrollRSS.prototype = {
    /**
	* C-r.
	*/
    initialize: function() {
        this.scrollRSS = $('rssFeed');
        this.scrollRSSHeight = this.scrollRSS.getHeight();
        this.scrollRSSCurrentOffset = 0;		
        this.intervalId = setInterval(this.scrollIt.bind(this), 30);

        this.scrollRSS.observe('mouseover', function() {
            this.mouseOver = true;
        }.bindAsEventListener(this));
        this.scrollRSS.observe('mouseout', function() {
            this.mouseOver = false;
        }.bindAsEventListener(this));
    },

    scrollIt: function() {
        if (this.mouseOver) {
            return;
        }
        
        if (-this.scrollRSSCurrentOffset>this.scrollRSSHeight) {
            this.scrollRSSCurrentOffset = $('rssFeedWrapper').getHeight();
        } else {
            this.scrollRSSCurrentOffset -= 1;
        }
        
        this.scrollRSS.setStyle({
            top: this.scrollRSSCurrentOffset+'px'
        });
    }
}

