function testify(video) {
    var video_viewer = new VideoViewer(video);
    return false;
}

var VideoViewer = new Class({
    initialize: function(video) {
        this.is_viewing = true;

        // Creation of HTML elements
        var body = $('soul-body');
        this.overlay = new Element('div', {'id': 'video-overlay'}).inject(body);
        this.overlay.setOpacity(0.7);
        this.core = new Element('div', {'id': 'video-core'}).inject(body);
        this.closer = new Element('a', {'id': 'video-closer', 'href': '#', 'text': 'Close', 'class': 'graphical'}).inject(this.core);
        this.video_top = new Element('div', {'id': 'video-top'}).inject(this.core);
        this.video_content = new Element('div', {'id': 'video-content'}).inject(this.core);
        this.video_bottom = new Element('div', {'id': 'video-bottom'}).inject(this.core);
        this.video_canvas = new Element('div', {'id': 'video-canvas'}).inject(this.video_content);
        var quickie = new Quickie(video, {
            id: 'video-viewer',
            width: 640,
            height: 360,
            container: 'video-canvas',
            attributes: {
                controller: 'true',
                autoplay: 'true'
            }
        });

        // Destruction
        var destroy_event = function() { this.destroy(); };
        this.bound_destroy_event = destroy_event.bind(this);
        this.closer.addEvent('click', this.bound_destroy_event);
        this.overlay.addEvent('click', this.bound_destroy_event);
    },

    destroy: function(e) {
        new Event(e).stop();
        this.is_viewing = false;
        this.core.dispose();
        this.overlay.dispose();
    }
});
