var player;
function playerReady(obj) {
	player = document.getElementById(obj['id']);
};

$j = jQuery
$j(document).ready(function() {

  player = document.getElementById('video_player');
  
  // Any link with the media-link class will load the
  // correct media into the associated player. 
  
  $j('.media-movie-link').click(function() {
    element           = $j(this);
    media_link        = element.attr("href");
    media_title       = element.find('img').attr("alt");
    options = $.fn.media.defaults;
    $j("#spotlight-video-title").html(media_title);
    player.sendEvent('STOP');
    player.sendEvent('LOAD', media_link );
    player.sendEvent('PLAY');
    return false;      
  });
});