$(document).ready(function(){

		// load the cycle plugin	
		$('#s1').cycle({ 
				fx:     'fade', 
				speed:  750, 
				next:   '#nextBtn', 
				prev:   '#prevBtn', 
				pause:   'true',		
				timeout: 0 
		});
	
		$('.VideoPlayer').hide();
		$('.close').hide();	
	
		$("#VideoThumbs img").fadeTo("slow", 1); //set the opacity of the thumbs to 100% when the page loads
		
		$("#VideoThumbs img").hover(function(){
		$(this).fadeTo("fast", 0.20); // set the opacity to 60% on hover
			},function(){
				$(this).fadeTo("slow", 1); // set the opacity back to 100% on mouseout
		});
	
		// initialise the google tracking module	
		$.gaTracker('UA-7210865-1');
	
		// load each the corresponding video when the thumbnail is clicked
		$('.video1').mousedown(function() {
			$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/25/parrots1yellow.flv&amp;autoplay=true');	
			$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
	
			// set the player unvisible and fade it in
			hidePlayer();
			fadeInPlayer();	
		});
		
		$('.video2').mousedown(function() {
			$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/25/parrots2darkred.flv&amp;autoplay=true');	
			$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
			// set the player unvisible and fade it in
			hidePlayer();
			fadeInPlayer();	
		});
	
		$('.video3').mousedown(function() {
			$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/25/parrots3lightblue.flv&amp;autoplay=true');	
			$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
			// set the player unvisible and fade it in
			hidePlayer();
			fadeInPlayer();	
		});
	
		$('.video4').mousedown(function() {
			$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/25/parrots4pink.flv&amp;autoplay=true');	
			$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
			// set the player unvisible and fade it in
			hidePlayer();
			fadeInPlayer();	
		});
	
		$('.video5').mousedown(function() {
			$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/25/parrots5sand.flv&amp;autoplay=true');	
			$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
			// set the player unvisible and fade it in
			hidePlayer();
			fadeInPlayer();	
		});
	
		$('.video6').mousedown(function() {
			$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/25/parrots6green.flv&amp;autoplay=true');	
			$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
			// set the player unvisible and fade it in
			hidePlayer();
			fadeInPlayer();	
		});
	
		$('.video7').mousedown(function() {
			$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/25/parrots7orange.flv&amp;autoplay=true');	
			$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
			// set the player unvisible and fade it in
			hidePlayer();
			fadeInPlayer();	
		});
	
		$('.video8').mousedown(function() {
			$('.VideoPlayer').attr('href', 'http://www.showstudio.com/swf/videoplayer.swf?src=http://www.showstudio.com/2008/09/25/parrots8black.flv&amp;autoplay=true');	
			$('.VideoPlayer').media( {   width: 480, height: 310, params:{allowFullScreen:true}, bgColor:'#000000', flashVersion:'9'  });
			// set the player unvisible and fade it in
			hidePlayer();
			fadeInPlayer();	
		});
	
	
		$('.close').mousedown(function() {  
			fadeOutPlayer();	    
	
		});
	
		function hidePlayer(){
			$('.VideoPlayer').hide();
			$('.close').hide();			
		}
	
		function fadeOutPlayer(){	
			$('.VideoPlayer').fadeOut('slow');
			$('.close').fadeOut('slow');	
		}
		
		function fadeInPlayer(){		
			$('.VideoPlayer').fadeIn('slow');
			$('.close').fadeIn('slow');	
		}

	
});



