$(document).ready(function() {
    pc.init();
    var winw = $(window).width();
    var winh = $(window).height();

    // Embed Video
    var flashvars = {
        playlistURL: playlistURL
    };
    var params = {
        allowfullscreen: 'true',
        allowscriptaccess: 'always',
        wmode: 'opaque'
    };
    var attributes = {};
    
    swfobject.embedSWF("/media/static/script/player2.swf", 'video', winw,
                       winh, "9.0.0", "expressInstall.swf", flashvars,
                       params, attributes);

    // Resize listener
    var t = null; 
    $(window).bind('resize', function() { 
        if (t) clearTimeout(t); 
        t = setTimeout(pc.resize, 100); 
    });
});

var pc = {
    player: null,
    init: function() {
        pc.player = $('#video');
        pc.content = $('#content');
    },
    resize: function() {
        var winw = $(window).width();
        var winh = $(window).height();
        pc.player.css({
            width: winw + 'px',
            height: winh + 'px'
        });
    }
};
