function hotNews(container, parameters) {
    var pointer = this;
    this.container = $(container);
    this.container.addClassName('HotNews');
    this.container.onmousedown = function() { return false; };
    this.parameters = parameters || {};
    this.parameters.period = this.parameters.period || 10000;
    this.container.setStyle("position: relative; overflow: hidden;");
    this.informations = this.container.childElements();
    this.informations.each(function(n) {
        n.setStyle("position: absolute; display: none; cursor: default;")
        n.onmousedown = function() { return false; };
    });
    this.buttons = [];
    var buttonsContainer = new Element('div', {'class': 'Buttons'});
    buttonsContainer.onmousedown = function() { return false; };

    for(var i = 0; i < this.informations.length; i++) {
        var button = new Element('div');
        var top = new Element('div', {'class': 'top'});
        var left = new Element('div', {'class': 'left'});
        var label = new Element('div', {'class': 'label'}).update(i + 1);
        var right = new Element('div', {'class': 'right'});
        var bottom = new Element('div', {'class': 'bottom'});
        button.insert(top).insert(left).insert(label).insert(right).insert(bottom);
        button.value = i;
        button.addClassName("Button");
        button.onclick = function() { pointer.changeTo(this.value); };
        button.onmousedown = function() { return false; };
        button.onmouseover = function() { this.addClassName('hover'); };
        button.onmouseout = function() { this.removeClassName('hover'); };
        this.buttons.push(button);
        buttonsContainer.insert(button);
    }
    this.container.insert(buttonsContainer);
    this.container.setStyle("display: block;");
    this.selected = 0;
    this.informations[0].appear();
    this.buttons[0].addClassName('selected');
    this.interval = false
    this.startSlide();
}

hotNews.prototype.changeTo = function(n) {
    var n = parseInt(n);
    if(isNaN(n) || n < 0 || n > this.informations.length-1 || n == this.selected) {
        return false;
    }
    this.buttons.each(function(button) { button.removeClassName('selected'); });
    this.informations[this.selected].fade();
    this.informations[n].appear();
    this.buttons[n].addClassName('selected');
    this.selected = n;
    this.startSlide();
    return this;
}

hotNews.prototype.next = function() {
    var next = this.selected + 1 < this.informations.length ? this.selected + 1 : 0;
    this.changeTo(next);
    return this;
}

hotNews.prototype.startSlide = function() {
    var pointer = this;
    clearInterval(this.interval);
    this.interval = setInterval(function() { pointer.next() }, this.parameters.period);
    return this;
}

hotNews.prototype.stopSlide = function() {
    clearInterval(this.interval);
    return this;
}
