$(document).ready(function(){
	
	/*
	$(".videoLinks ul li a").click(function() {
		$(this).parent().siblings().children('a').removeClass('currentLink');
		document.movie.SetURL($(this).attr('href'));
		$(this).addClass('currentLink');
		return false;
	});
	*/
	
	var title = $(".videoLinks ul li a:first").text();
	var location = $(".videoLinks ul li a:first").attr('href');
	var filename = location.split(".flv");
	filename = filename[0];

	$(".videoPlayerWrap").flash({
  	swf: '/content/video/player.swf',  
    width: 320,  
    height: 240,  
    flashvars: {  
    	file: location, 
    	image: filename + ".jpg"
    }
  });

	$('.videoTitle').html("<strong>" + title + "</strong> <a href='"+filename+".mov'>Download QuickTime version</a>");
	$(".videoLinks ul li a:first").addClass('currentLink');

	$(".videoLinks ul li a").click(function() {
    title = $(this).text();
		location = $(this).attr('href');
    filename = location.split(".flv");
    filename = filename[0];
		$(this).parent().siblings().children('a').removeClass('currentLink');
    $('.videoPlayerWrap').flash({
      swf: '/content/video/player.swf',  
      width: 320,  
      height: 240,  
      flashvars: {  
        file: location, 
        image: filename + '.jpg'
      }
    });
		$('.videoTitle').html("<strong>" + title + "</strong> <a href='"+filename+".mov'>Download QuickTime version</a>");
		$(this).addClass('currentLink');
		return false;
	});

});
