jQuery(document).ready(function() {
	
	/**
	 * Homepage Carousel
	 */
	var $carousel_navigation = jQuery('.carousel-navigation');
	
	jQuery('#carousel ul.items')
		.cycle({
			timeout: 5000
			, fx: 'scrollHorz'
			, speed: 1300
			, easing: 'easeOutExpo'
			, prev: $carousel_navigation.find('#prev a')
			, next: $carousel_navigation.find('#next a')
			, before: function(currSlideElement, nextSlideElement, options, forwardFlag)
			{
				var $c = $(currSlideElement);
				var $n = $(nextSlideElement);
				
				var $carousel_content = $carousel_navigation.siblings();
				
				// don't animate the very first slide (when the page loads)
				if ($carousel_content.hasClass('first')) {
					$carousel_content.removeClass('first');
				} else {
					$carousel_content.stop(true, true).fadeOut(450, function() {
						jQuery(this).each(function() {
							jQuery(this).html($n.children(this.tagName).html());
						});
					}).delay(100).fadeIn(600);
				}
			}
		});
	
	// show the carousel navigation
	$('.carousel-navigation').show();

	/**
	 * Tease the tasks
	 */
	$('#quick-links a').trigger('mouseover');
	$('#tasks').delay(500).trigger('mouseout');

});
	/**
	 * ClubNights Carousel
	 */
jQuery(document).ready(function() {

	var $carousel_navigation = jQuery('.carousel-navigation1');
	
	jQuery('#carousel1 ul.items1')
		.cycle({
			timeout: 5000
			, fx: 'scrollHorz'
			, speed: 1300
			, easing: 'easeOutExpo'
			, prev: $carousel_navigation.find('#prev1 a')
			, next: $carousel_navigation.find('#next1 a')
			, before: function(currSlideElement, nextSlideElement, options, forwardFlag)
			{
				var $c = $(currSlideElement);
				var $n = $(nextSlideElement);
				
				var $carousel_content = $carousel_navigation.siblings();
				
				// don't animate the very first slide (when the page loads)
				if ($carousel_content.hasClass('first')) {
					$carousel_content.removeClass('first');
				} else {
					$carousel_content.stop(true, true).fadeOut(450, function() {
						jQuery(this).each(function() {
							jQuery(this).html($n.children(this.tagName).html());
						});
					}).delay(100).fadeIn(600);
				}
			}
		});

	// show the carousel navigation
	$('.carousel-navigation1').show();

	/**
	 * Tease the tasks
	 */
	$('#quick-links a').trigger('mouseover');
	$('#tasks').delay(500).trigger('mouseout');

});
	/* carousel2 */
jQuery(document).ready(function() {

	var $carousel_navigation = jQuery('.carousel-navigation2');
	jQuery('#carousel2 ul.items2')
		.cycle({
			timeout: 5000
			, fx: 'scrollHorz'
			, speed: 1300
			, easing: 'easeOutExpo'
			, prev: $carousel_navigation.find('#prev2 a')
			, next: $carousel_navigation.find('#next2 a')
			, before: function(currSlideElement, nextSlideElement, options, forwardFlag)
			{
				var $c = $(currSlideElement);
				var $n = $(nextSlideElement);
				
				var $carousel_content = $carousel_navigation.siblings();
				
				// don't animate the very first slide (when the page loads)
				if ($carousel_content.hasClass('first')) {
					$carousel_content.removeClass('first');
				} else {
					$carousel_content.stop(true, true).fadeOut(450, function() {
						jQuery(this).each(function() {
							jQuery(this).html($n.children(this.tagName).html());
						});
					}).delay(100).fadeIn(600);
				}
			}
		});

	// show the carousel navigation
	$('.carousel-navigation2').show();

	/**
	 * Tease the tasks
	 */
	$('#quick-links a').trigger('mouseover');
	$('#tasks').delay(500).trigger('mouseout');

});
	/* carousel3 */

jQuery(document).ready(function() {

	var $carousel_navigation = jQuery('.carousel-navigation3');
	jQuery('#carousel3 ul.items3')
		.cycle({
			timeout: 5000
			, fx: 'scrollHorz'
			, speed: 1300
			, easing: 'easeOutExpo'
			, prev: $carousel_navigation.find('#prev3 a')
			, next: $carousel_navigation.find('#next3 a')
			, before: function(currSlideElement, nextSlideElement, options, forwardFlag)
			{
				var $c = $(currSlideElement);
				var $n = $(nextSlideElement);
				
				var $carousel_content = $carousel_navigation.siblings();
				
				// don't animate the very first slide (when the page loads)
				if ($carousel_content.hasClass('first')) {
					$carousel_content.removeClass('first');
				} else {
					$carousel_content.stop(true, true).fadeOut(450, function() {
						jQuery(this).each(function() {
							jQuery(this).html($n.children(this.tagName).html());
						});
					}).delay(100).fadeIn(600);
				}
			}
		});

	// show the carousel navigation
	$('.carousel-navigation3').show();

	/**
	 * Tease the tasks
	 */
	$('#quick-links a').trigger('mouseover');
	$('#tasks').delay(500).trigger('mouseout');

});
	/* carousel4 */

jQuery(document).ready(function() {

	var $carousel_navigation = jQuery('.carousel-navigation4');

	jQuery('#carousel4 ul.items4')
		.cycle({
			timeout: 5000
			, fx: 'scrollHorz'
			, speed: 1300
			, easing: 'easeOutExpo'
			, prev: $carousel_navigation.find('#prev4 a')
			, next: $carousel_navigation.find('#next4 a')
			, before: function(currSlideElement, nextSlideElement, options, forwardFlag)
			{
				var $c = $(currSlideElement);
				var $n = $(nextSlideElement);
				
				var $carousel_content = $carousel_navigation.siblings();
				
				// don't animate the very first slide (when the page loads)
				if ($carousel_content.hasClass('first')) {
					$carousel_content.removeClass('first');
				} else {
					$carousel_content.stop(true, true).fadeOut(450, function() {
						jQuery(this).each(function() {
							jQuery(this).html($n.children(this.tagName).html());
						});
					}).delay(100).fadeIn(600);
				}
			}
		});
		
	// show the carousel navigation
	$('.carousel-navigation4').show();
	
	/**
	 * Tease the tasks
	 */
	$('#quick-links a').trigger('mouseover');
	$('#tasks').delay(500).trigger('mouseout');

});
