CloseButton = {

    didAppendContent: function(view, content) {
        this.view = view;

        var section = view.currentSection;
        if (section.movieLink && !section.movieLink.href.match('qtvr')) {
            if (!section.close) {
                section.close = new Element('a', { className:'close '+view.triggerClassName, href:'#' }).insert('Cerrar');
                section.content.insertBefore(section.close, section.content.firstChild);
            }

            var previous = (view.previousSection) ? view.previousSection.id : view.orderedSections[0];
            section.close.href = '#'+previous;
        }
    },

    didShow: function(view, outgoing, incoming) {
        this.didAppendContent(view, incoming.content);
        this.didShow = function() {};
    }
}
