$(document).ready(function() {
    $('.reel-player-container nav ul li a').hover(function() {
        $('.current-hover-title').html($(this).children('.thumbnail').attr('title'));
    });
    
    // Video lightboxing
    $('.reel-player-container nav ul li a').click(function() {
        
        var videoID = $(this).attr("id");
        
        $.getJSON("/" + contentPath + contentFile, function(data) {
            var filename, title, description;
            $.each(data.videos, function(i, video) {
                if ( video.id == videoID ) {
                    filename = video.videoFilename;
                    thumb = video.thumbFilename;
                    still = video.stillFilename;
                    title = video.title;
                }
            });

            $('.current-video').html(innerShiv('\
                <object width="640" height="360" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf">\
                    <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf" />\
                    <param name="allowfullscreen" value="true" />\
                    <param name="flashvars" value=\'config={"playlist":["' + absoluteURL + '/' + contentPath + 'stills/' + still + '", {"url": "' + absoluteURL + '/' + contentPath + 'videos/' + filename + '.flv","autoPlay":false,"autoBuffering":true}]}\' />\
                    <img src="' + absoluteURL + '/' + contentPath + 'stills/' + still + '" width="640" height="360" alt="Poster Image" title="No video playback capabilities." />\
                </object>\
            '));
        });  	    
    });
});

