var rotatequote = Class.create();

rotatequote.prototype = {
    myquotes: new Array(
        '<a href=\"https://fubar.com/vic.php\">Become a VIP</a>',
        '<a href=\"https://fubar.com/vic.php\">Unlock Features!</a>'
        ),
    div: null,

    initialize: function() {
        this.div = $('quotetext');
        if (this.div) {
            Event.observe(window,'resize',this.Resize.bind(this));

            this.Resize();
            this.Timer();

            setInterval(this.Timer.bind(this),2000);
        }
    },

    Resize: function() {
        if (this.div) {
            var twidth = 90;
            var tmp = $('chromemenu');
            if (tmp) {
                twidth+= tmp.getWidth();
            }
            var tmp = $('chromemenu2');
            if (tmp) {
                twidth+= tmp.getWidth();
            }
            twidth = z_getWidth() - twidth;
            this.div.setStyle({width: twidth+'px'});    
        }
    },

    Timer: function() {
        if (this.div) {
            var thequote = this.myquotes.shift(); //Pull the top one
            this.myquotes.push(thequote); //And add it back to the end
            this.div.update(thequote);
        }
    }
}
