/* Author:

*/

$(document).ready(function(){

	var firstRun = true;

	$('#slideshow').cycle({
		fx: 'scrollHorz',
		timeout: 0,
		easing: 'easeInOutExpo',
		prev: '.btn-prev',
        next: '.btn-next',
        before: function(currSlideElement, nextSlideElement, options, forwardFlag){
        	var ns = options.nextSlide + 1;
        	if(ns > options.slideCount) ns = 1;
        	if(ns < 1) ns =options.slideCount;
			if(!firstRun) $('.prog-box span').html(ns);
			if(firstRun) firstRun = false;
		}
	});

	$('#slideshow-collection').cycle({
		fx: 'scrollHorz',
		timeout: 0,
		easing: 'easeInOutExpo',
		pager:  '#color-nav', 
     
	    // callback fn that creates a thumbnail to use as pager anchor 
	    pagerAnchorBuilder: function(idx, slide) { 
	        return '<li><a href="#" style="background-color: '+ $(slide).attr('rel') +'"><span>' + $(slide).attr('title') + '</span></a></li>'; 
	    } 
	});

	$('.hide-intro').on('click', function(e){
		e.preventDefault();
		$('.intro').fadeOut();
		$('.hide-from-intro').show();
	});

});





