//--------------------------------------------------
// SLIDESHOW
//--------------------------------------------------
$(document).ready( function($) {
	function slideShow() {
		var active = $('#home-slideshow .active');
		var next = active.next();
		
		if ( active.is(':last-child') ) {
			var next = $('#home-slideshow .slide:first');
		}
		
		next.addClass('next').show();
		active.fadeOut(2000, function() {
			next.removeClass('next').addClass('active');
			active.removeClass('active');
		});
	}
	
	setInterval(slideShow, 6000);
});

	
//--------------------------------------------------
// NAVIGATION ROLL OVER
//--------------------------------------------------
$(document).ready( function($) {
	$('h1#home-navigation a').hover( function() {
		var name = $(this).attr('id');
		
		$('div#navigation-images div.' + name).addClass('active').show();
	}, function() {
		var name = $(this).attr('id');
		
		$('div#navigation-images div.' + name).removeClass('active').hide();
	});
});


//--------------------------------------------------
// NAVIGATION
//--------------------------------------------------
$(document).ready( function($) {
	$('h1#home-navigation a, h1#home-navigation span').hide();
});


$(window).load( function() {
	var wordInterval = 800;
	var wordSpeed = 1000;
	var circleInteval = 800;
	var circleSpeed = 800;
	
	$('h1#home-navigation a#we').fadeIn(wordSpeed);
	
	setTimeout( function() {
		$('h1#home-navigation a#navigate').fadeIn(wordSpeed);
		
		setTimeout( function() {
			$('h1#home-navigation a#leaders').fadeIn(wordSpeed);
			
			setTimeout( function() {
				$('h1#home-navigation span#through').fadeIn(wordSpeed);
				
				setTimeout( function() {
					$('h1#home-navigation a#growth-challenges').fadeIn(wordSpeed);
					
					setTimeout( function() {
						$('h1#home-navigation span#with').fadeIn(wordSpeed);
						
						setTimeout( function() {
							$('h1#home-navigation a#vision-clarity').fadeIn(wordSpeed);
							
							setTimeout( function() {
								$('h1#home-navigation a#we span.circle').fadeIn(circleSpeed, function() {
									$('h1#home-navigation a#we span.circle').fadeOut(circleSpeed, function (){
										$('h1#home-navigation a#we span.circle').attr('style', '');
									});
								});
								
								setTimeout( function() {
									$('h1#home-navigation a#navigate span.circle').fadeIn(circleSpeed, function() {
										$('h1#home-navigation a#navigate span.circle').fadeOut(circleSpeed, function (){
											$('h1#home-navigation a#navigate span.circle').attr('style', '');
										});
									});
									
									setTimeout( function() {
										$('h1#home-navigation a#leaders span.circle').fadeIn(circleSpeed, function() {
											$('h1#home-navigation a#leaders span.circle').fadeOut(circleSpeed, function (){
												$('h1#home-navigation a#leaders span.circle').attr('style', '');
											});
										});
										
										setTimeout( function() {
											$('h1#home-navigation a#growth-challenges span.circle').fadeIn(circleSpeed, function() {
												$('h1#home-navigation a#growth-challenges span.circle').fadeOut(circleSpeed, function (){
													$('h1#home-navigation a#growth-challenges span.circle').attr('style', '');
												});
											});
											
											setTimeout( function() {
												$('h1#home-navigation a#vision-clarity span.circle').fadeIn(circleSpeed, function() {
													$('h1#home-navigation a#vision-clarity span.circle').fadeOut(circleSpeed, function (){
														$('h1#home-navigation a#vision-clarity span.circle').attr('style', '');
													});
												});
											}, circleInteval);
										}, circleInteval);
									}, circleInteval);
								}, circleInteval);
							}, circleInteval);
						}, wordInterval);
					}, wordInterval);
				}, wordInterval);
			}, wordInterval);
		}, wordInterval);
	}, wordInterval);
});


