/* 
	Author: Justin Luk
	Created on: October 31st, 2011 (Boo!)
*/
$(function() { 
	
	$('.slideshow-nav a').click( function(e) {
		e.preventDefault();
	} );
	
	// $('#slideshows').cycle();
	
	// start the new slide's slideshow
	$('#slideshows').cycle( {
		fx: 'scrollDown',
		timeout: 0,
		speed: 'fast'
	} );
	
	$('.slideshow').each( function(i) {
		$(this).cycle( {
			fx: 'scrollHorz',
			timeout: 0,
			speed: 'fast',
			pager:  $(this).siblings('.slideshow-nav').find('.pager'),
			next:   $(this).siblings('.slideshow-nav').find('li.next a'), 
			prev:   $(this).siblings('.slideshow-nav').find('li.prev a'),
		} );
	} );
	
	$('.client').each( function(i) {
		$(this).click( function( e ) {
			e.preventDefault();
			$('#slideshows').cycle(i);
		});
	} );
	
} );

// 
// var inners = $('.inner-slideshow').cycle().cycle('stop');
// 
// $('#slideshow').cycle( {
// 	fx:     'scrollVert', 
//   speed:  'fast', 
//   timeout: 0,
// 	before: function() {
// 		// stop all inner slideshows
// 		inners.cycle('stop');
// 		
// 		// start the new slide's slideshow
// 		$(this).cycle({
// 			fx: 'scrollHorz',
// 			speed: 'fast',
// 			pager:  '#slideshow-pager',
// 			next:   '#slideshow-nav li.next a', 
// 		  prev:   '#slideshow-nav li.prev a',
// 			autostop: true,
// 			end: function() {
// 				// when inner slideshow ends, advance the outer slideshow
// 				slideshow.cycle('next');
// 			}
// 		});
// 		
// 		$('.client').click( function( e ) {
// 			console.log(this);
// 			e.preventDefault();
// 		});
// 	}

