function headlineScroller(elementsSel, containerSel){
    var that = this;
    this.elements = $$(elementsSel);
    // Don't do anything if there are less than two items.
    if(this.elements.length < 2) return;
    this.container = $$(containerSel)[0];
    this.start = function start(){
        if($type(this.current) === false) this.current = 0;
        
        if(that.elements.length > that.current+1) {
            var next = that.current+1;
        } else {
            var next = 0;
        }
        var inVal = this.container.getSize().y;
        var outVal = -(this.elements[this.current].getSize().y)
        var fxIn = new Fx.Tween(this.elements[next], {property:'top', transition:Fx.Transitions.Quad.easeOut, duration:700});
        fxIn.set(inVal);
        var fxOut = new Fx.Tween(this.elements[this.current], {property:'top', transition:Fx.Transitions.Quad.easeOut, duration:700});
        fxIn.start(0);
        fxOut.start(outVal)
        this.current = next;
        this.running = arguments.callee.delay(6000, this);
    }
    this.stop = function stop(){
        $clear(this.running);
    }
    this.start.delay(3000, this);
}
window.addEvent('load', function(){ new headlineScroller('.item', '.announce_bottom') });
