$(document).ready(function() {	

	var slideChangeInit = false
	
	$('#loading').css({'width' : '100%'});
	$('#thumbs').galleriffic({
		imageContainerSel:      '#slideshow',
		autoStart:              true,
		onSlideChange:			function(prevIndex, nextIndex) { 
			var imageData = this.data[nextIndex]
			if (!this.isSlideshowRunning && slideChangeInit) document.location = $("#slideshow a.noscript").attr("href") + '?' + imageData.slideUrl
			slideChangeInit = true 
			this.play()
		}
	});


	$('#poster-expand, #poster-image').toggle(function() {
		$('#showposter-2011').animate({
			height:895
		}, 2000, function(){})
	}, function(){
		$('#showposter-2011').animate({
			height:690
		}, 2000, function(){})
	});
	
	$("#banner-thriller-2011").hide();
	
	var videos;
	$('a#thriller').toggle(function() {
		$("#banner-thriller-2011").show();
		videos = VideoJS.setup("All");
		location.href=$(this).attr("href");
	}, function() {
		videos[0].pause();
		$("#banner-thriller-2011").hide();
	})
	

});

