// thumbs scroller

$(function () {
	var $prev = $("a#thumbsLeft"); //prev button
	var $next = $("a#thumbsRight"); //next button
	// scroll thumbs
	$("#thumbsScroll").serialScroll({
		items: 'a',
		prev: 'a#thumbsLeft',
		next: 'a#thumbsRight',
		start: 0, 
		step: 3,
		duration: 1000,
		stop: true,
		lock: false,
		force: true,
		easing: 'easeOutQuad',
		cycle: false,
		axis: 'x',
		offset: 0,
		exclude: 2,
		onBefore:function( e, elem, $pane, $items, pos ){
			$next.fadeIn(200);
			if( pos == 0 )
				$prev.fadeOut(200);
			else if( pos >= $items.length-3 )
				$next.hide();
				$prev.show();
		}
	});
});

// banner image scroller

$(function () {
	var $prevImg = $("a#scrollLeft"); //prev button
	var $nextImg = $("a#scrollRight"); //next button
	// scroll thumbs
	$("#bannerScroll").serialScroll({
		items: 'div.panel',
		prev: '.prev',
		next: '.next',
		start: 0, 
		step: 1,
		duration: 1000,
		stop: true,
		lock: false,
		force: true,
		easing: 'easeOutQuad',
		cycle: false,
		axis: 'x',
		offset: 0,
		onBefore:function( e, elem, $pane, $items, pos ){
			$prevImg.add($nextImg).fadeIn(1000);
			if( pos == 0 )
				$prevImg.fadeOut(200);
			else if( pos >= $items.length-1 )
				$nextImg.fadeOut(200);
		}
	});
});

// video

$(function () {
	$("#openVid").click(function(){
		$("#video").fadeIn(400);
		return false;
	});
	$("#closeVid").click(function(){
		$("#video").fadeOut(400);
		return false;
	});
});

// close the video if you push the gallery thumb
$(function () {
	$(".next").click(function(){
		$("#video").hide();
		return false;
	});
});









