/**
 * Video Class
 */
Video = new Class({
    /**
     * Constructor
     *
     * @param string
     */
    initialize: function(element_id) {
        // first check flash version
        if (Browser.Plugins.Flash.version < 9) {
            return;
        }

        var container = document.id(element_id);

        // guard
        if (!container) {
            return;
        }

        // get the anchor, the url to the flv is in the href and the url to the player in the rel attribute
        var anchor = container.getElement('a');

        // guard
        if (!anchor) {
            return;
        }

        var player = new Swiff(anchor.get('rel'), {
            container: container,
            id: 'tbi-movie',
            width: 482,
            height: 323,
            params: {
                allowfullscreen: 'true',
                allowscriptaccess: 'true',
                wmode: 'opaque',
                bgcolor: '#ffffff',
                scale: 'noscale',
                salign: 'tl'
            },
            vars: {
                video_path: anchor.get('href')
            }
        });
    }
});
