$(document).ready(function(){

	
		// load the first movie when the page is ready
		$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/18/zeropointzero.flv&amp;autoplay=true');	
		$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });	
		$.gaTracker('UA-7210865-1');	
	
	

	// load each the corresponding video when the thumbnail is clicked
	$('.video1').mousedown(function() {
	    removeSelectedNav();
		$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/18/zeropointzero.flv&amp;autoplay=true');	
		$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
	    $(".desc1").addClass("selected");
	    $(".video1 img").addClass("selectedThumb");	
	});
	
	$('.video2').mousedown(function() {
	    removeSelectedNav();
		$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/18/research1.flv&amp;autoplay=true');	
		$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
	    $(".desc2").addClass("selected");
	    $(".video2 img").addClass("selectedThumb");	    
	});

	$('.video3').mousedown(function() {
	    removeSelectedNav();
		$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/18/research2.flv&amp;autoplay=true');	
		$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
	    $(".desc3").addClass("selected");		
	    $(".video3 img").addClass("selectedThumb");	    
	});

	// load each the corresponding video when the link is clicked - same as for the thumbs
	$('.desc1').mousedown(function() {	
	    removeSelectedNav();
		$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/18/zeropointzero.flv&amp;autoplay=true');	
		$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
	    $(".desc1").addClass("selected");
	    $(".video1 img").addClass("selectedThumb");	
	});
	
	$('.desc2').mousedown(function() {
	    removeSelectedNav();
		$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/18/research1.flv&amp;autoplay=true');	
		$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
	    $(".desc2").addClass("selected");
	    $(".video2 img").addClass("selectedThumb");	    
	});

	$('.desc3').mousedown(function() {
	    removeSelectedNav();
		$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/18/research2.flv&amp;autoplay=true');	
		$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
	    $(".desc3").addClass("selected");		
	    $(".video3 img").addClass("selectedThumb");	    
	});

	function removeSelectedNav()
	{
	    $(".selected").removeClass("selected");
		$(".selectedThumb").removeClass("selectedThumb");
	}
	
});


