jQuery(document).ready(function($) {
	
	$('.wpns_thumb_slider').scrollingCarousel({
		looped: false
	});
	
	$('.movieSelect').click(function() {
		$('.video-js').each(function(index) {
		    $(this).get(0).pause();
		 });
				
		$('.movieSelect.active').removeClass('active');
		$('.movie.active').hide();
		$('.movie.active').removeClass('active');
					
		var video = $(this).attr('rel');
		
		$(this).addClass('active');
		$('#' + video).show();
		$('#' + video).addClass('active');
		$('#' + video).find('.video-js').get(0).play();
		
		return false;
	});
	

			var swipeOptions=
			{
				swipeLeft:swipeLeft,
				swipeRight:swipeRight,
				threshold:0
				
				
			}
			
			$(".panel").swipe( swipeOptions );
			
			function swipeLeft(event)	
			{
				var current = $(this).attr('rel'); var next = parseInt(current) + 1; $('.panel-' + next).click();
			}
			
			function swipeRight(event)	
			{
				var current = $(this).attr('rel'); var prev = parseInt(current) - 1; $('.panel-' + prev).click();
			}
	
});

