video_info = {};
video_info['Teaching'] = ["This is the seventh day of class in the Spring '09 Introduction to Mobile Devices 395/495 at Northwestern.  I clarify my answers to questions during the previous class, we discuss the first of the two large projects in the course, and then I lecture about using UIViewControllers on iPhone.", "newNateTeachingSmaller264Jiggered.mp4", "newNateTeaching.mp4", "mp4"];
video_info['ScienceNation'] = ["This is a video that Science Nation made about News at Seven for the National Science Foundation and the Discovery Channel.  It gives a good high-level explanation of News at Seven.", "ScienceNation.mov", "ScienceNation.mov", "mov"];
video_info["MVCPart1"] = ["This is the first part of a screencast I did going through XCode and Model-View-Controller", "MVCPart1.mp4", "MVCPart1.mp4", "mp4"];
video_info["MVCPart2"] = ["This is the second part of a screencast I did", "MVCPart2.mp4", "MVCPart2.mp4", "mp4"];
video_info['OriginalNAS'] = ['This is a video of the original version of News at Seven, running in the Half-Life 2 (Source) engine', 'NewsShow.mp4', 'NewsShow.mp4', 'mp4'];
video_info['MovieReview'] = ['This is the newest version of News at Seven.  Zack and Zooey are reviewing the movie Taken; everything they say was chosen by the system, pulled from sites like IMDB, RottenTomatoes, and MetaCritic.', 'NewMovieReview.mp4', 'NewMovieReview.mp4', 'mp4'];
video_info['CNJ'] = ['This is a video of myself talking about News at Seven at the Computational Journalism Symposium in 2008.  I was an invited speaker on the Information Mashups: Aggregation, Syndication, and Web Services panel.  (I take the stage about five minutes into the video.)', 'cnj_panel.flv'];
//video_info['CNJ'] = ['This is a video of myself talking about News at Seven at the Computational Journalism Symposium in 2008.  I was an invited speaker on the Information Mashups: Aggregation, Syndication, and Web Services panel.  (I take the stage about five minutes into the video.)', 'http://www.c-spanarchives.org/flashXml/290102-1'];

$(document).ready(function () {
    if (typeof console === 'undefined') {
       console = {
           log: function(str) {}
       }
    }
    $('.video-link').click(ShowVideo); 
    $('.sidebar-indicator').hide();
    $(".sidebar li").hover(function () {$('.sidebar-indicator', this).show();}, function () { $('.sidebar-indicator', this).hide(); });
    $("li.video-title").hover(function () {$('.sidebar-indicator', this).show();}, function () { $('.sidebar-indicator', this).hide(); });
});

function ShowVideo (evt) {
    var a_tag = $(evt.target);
    //console.log("id is %o", a_tag.attr('id'));
    var id = a_tag.attr('id');
    console.log("id is " + id);
    var info = video_info[id];
    var s1 = new SWFObject('player.swf','player','400','300','9');
    s1.addParam('allowfullscreen','true');
    s1.addParam('allowscriptaccess','always');
    
    s1.addParam('flashvars','autostart=true&file=media/' + info[1]);
    s1.write('video-preview');
    console.log("Wrote video preview thing, file is media/" + info[1]);
    
    if (info[2] != undefined) {
        $('.video-download').html('Download as <a href="media/' + info[2] + '">.' + info[3] + '</a>');
    }
    $('.video-info').html(info[0]);
}





