jQuery(document).ready(function(){
	
	$('#carousel-items')
	.carousel({

		// Appearance
		width               : null,      // Override the default CSS width
		height              : null,      // Override the default CSS height
		easing              : "swing",   // Anything other than "linear" or "swing" requires the easing plugin
		buildStartStop      : false,     // ** If true, builds the start/stop button
		startText           : "PLAY",    // Start button text
		stopText            : "PAUSE",   // Stop button text
		
		// Navigation
		navigationFormatter : function(index, panel){
			return ['Branded3', 'Award', 'e-Commerce', 'Talent'][index - 1];
		},
		
		// Slideshow options
		autoPlay            : true,      // This turns off the entire slideshow FUNCTIONALY, not just if it starts running or not
		autoPlayLocked      : true,      // If true, user changing slides will not stop the slideshow
		pauseOnHover        : false,     // If true & the slideshow is active, the slideshow will pause on hover
		resumeOnVideoEnd    : true,      // If true & the slideshow is active & a youtube video is playing, it will pause the autoplay until the video has completed
		
		// Times
		delay               : 8000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
		resumeDelay         : 10000,     // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		animationTime       : 500,       // How long the slideshow transition takes (in milliseconds)
		
		// Callbacks - removed from options to reduce size - they still work
		
		// Interactivity
		onSlideComplete: function(slider){
        	var skinName = $.trim( slider.$nav.find('.cur').text() ).toLowerCase().replace(/ /g, '-');
        	$('#branding').attr('class', 'skin-' + skinName);
			$('#carousel').attr('class', 'skin-' + skinName);
    	},
		
		// Video
		addWmodeToObject    : 'transparent'

	})
	.carouselFx({
		// base FX definitions
		// '.selector' : [ 'effect(s)', 'distance/size', 'time', 'easing' ] - 'time' and 'easing' are optional parameters
		
		'.carousel-item-branded3 .fg h2' : [ 'listLR' ],
		'.carousel-item-branded3 .fg h3' : [ 'listLR' ],
		'.carousel-item-branded3 .fg p' : [ 'listLR' ],
		'.carousel-item-branded3 .video' : [ 'listRL' ],
		
		'.carousel-item-award .fg img': [ 'fade' ],
		'.carousel-item-award .fg h2' : [ 'listRL', '500px', '500', 'easeOutCirc' ],
		'.carousel-item-award .fg p' : [ 'listLR' ],
		'.carousel-item-award .fg a': [ 'fade' ],
		
		'.carousel-item-e-commerce .fg .content' : [ 'listLR' ],
		
		'.carousel-item-talent .fg img': [ 'fade' ],
		'.carousel-item-talent .fg h2' : [ 'top fade', '500px', '800', 'easeOutElastic' ],
		'.carousel-item-talent .fg p' : [ 'top fade', '500px', '800', 'easeOutElastic' ]
		
		// for more precise control, use the "in" and "out" definitions
		// in = the animation that occurs when you slide "in" to a panel
		/*,
		inFx : {
			'.carousel-item-branded3 .video' : { opacity: 1, right : 0, duration: 800, easing : 'easeInExpo' },
			'.carousel-item-branded3 .fg h1, .carousel-item-branded3 .fg h2' : { opacity: 1, left : 0, duration: 500, easing : 'easeInExpo' },
			'.textSlide li'  : { opacity: 1, left : 0, duration: 400 },
			'.textSlide img' : { opacity: 1, duration: 400 },
			'.quoteSlide'    : { top : 0, duration: 400, easing : 'easeOutElastic' },
			'.expand'        : { width: '100%', top: '0%', left: '0%', duration: 400, easing : 'easeOutBounce' }
		},
		// out = the animation that occurs when you slide "out" of a panel
		// (it also occurs before the "in" animation) - outFx animation time is 1/2 of inFx time
		outFx : {
			'.carousel-item-branded3 .video' : { opacity: 0, right : '-200px', duration: 500, easing : 'easeOutExpo' },
			'.carousel-item-branded3 .fg h1, .carousel-item-branded3 .fg h2' : { opacity: 0, left : '-200px', duration: 500, easing : 'easeOutExpo' },
			'.textSlide li:odd'  : { opacity: 0, left : '-200px', duration: 200 },
			'.textSlide li:even' : { opacity: 0, left : '200px',  duration: 200 },
			'.textSlide img'     : { opacity: 0, duration: 200 },
			'.quoteSlide:first'  : { top : '-500px', duration: 200 },
			'.quoteSlide:last'   : { top : '500px', duration: 200 },
			'.expand'            : { width: '10%', top: '50%', left: '50%', duration: 200 },
		}*/
	});
	
	$(".b3-video").colorbox({
		iframe: true,
		innerWidth: 720,
		innerHeight: 490
	});
	
});


