$(document).ready(function(){
    // video library player
    $('#flash').flash(
        null,
        { version: 9 },
        function(opt) {
            $this = $(this);
            var p = $this.children().attr('rel').split(';');
            opt.allowfullscreen = false;
            opt.src = p[0];
            opt.width = 500;
            opt.height = 405;

            if ( p[1] ) opt.flashvars.src = p[1];
            $this.before($.fn.flash.transform(opt));
            //alert($.fn.flash.transform(opt));
            $('#embed_code').attr('value', $.fn.flash.transform(opt));
        }
    ).empty();
    
    // blog video player
    $("a[href$=flv]").flash(
        null,
        { version: 9 },
        function(opt) {
            $this = $(this);
            opt.allowfullscreen = true;
            opt.src = "/static/default/swf/3fsPlayer.swf";
            opt.flashvars.src = $this.attr('href');
            opt.width = 500;
            opt.height = 405;
            
            $this.before($.fn.flash.transform(opt));
        }
    ).empty();    
});