$(document).ready(function() {
	/*var navTimeout;
	$('#menu-main-menu li#menu-item-25').hover(function(){
		navTimeout = setTimeout(function(){
			$('li#menu-item-25 ul.sub-menu').slideDown();
		}, 500);
		$(this).children('a').css('color', '#f06624');
		$(this).children('a').css('text-decoration', 'underline');
	},function(){
		clearTimeout(navTimeout);
		$('li#menu-item-25 ul.sub-menu').slideUp();
		$(this).children('a').css('color', '#998675');
		$(this).children('a').css('text-decoration', 'none');
	});*/
		
	// New Intro Animation
	
	setTimeout(function(){
		$('.loading').fadeOut('fast');
	}, 250);
	
	var numberSlides = $('.intro-mask .an-intro').size();
    $('.intro-mask .an-intro').hide(); // Hide the slides
    
    setTimeout(function(){ // Show the first slide
        $('.intro-mask .an-intro:first').fadeIn('slow');
    }, 750);
    
    var countIt = 1;
    
    setInterval(function(){ // Rotate through subsequent slides
        
        var visibleSlide = $('.intro-mask .an-intro:visible');
        
        if (countIt == numberSlides) {
        
            $(visibleSlide).fadeOut('slow', function(){
                $('.intro-mask .an-intro:first').fadeIn();
            });
            countIt = 1;
        
        } else {
                
            $(visibleSlide).fadeOut('slow', function(){
                $(this).next().fadeIn();
            });
            countIt++;
        }
        
    }, 4000);
			
	/*var theIntro = [];  // OLD INTRO ANIMATION
	$('.an-intro').each(function() {
		var theWidth = $(this).find('img').width();
		var theHeight = $(this).find('img').height();
		console.log(theHeight);
		var newWidth = theWidth * 0.5;
		var newHeight = theHeight * 0.5;
		console.log(newHeight);
		$(this).find('img').css('width', newWidth).css('height', newHeight);
	    theIntro.push(this);
	});
	
	setTimeout(function(){
		var currentSlide = $(theIntro[0]);
		var theWidth2 = currentSlide.find('img').width();
		var theHeight2 = currentSlide.find('img').height();
		var newWidth2 = theWidth2 * 2;
		var newHeight2 = theHeight2 * 2;
	   	currentSlide.animate({left: '0px'}, 2000, 'easeInOutExpo');
	   	setTimeout(function(){
	   		currentSlide.find('img').animate({width: newWidth2, height: newHeight2}, 3000);
	   	}, 1500);
	    theIntro.splice(0,1);
	    
	    setTimeout(function(){
		    var theShow = setInterval(function(){
		    	var currentSlide = $(theIntro[0]);
		    	var theWidth2 = currentSlide.find('img').width();
				var theHeight2 = currentSlide.find('img').height();
				var newWidth2 = theWidth2 * 2;
				var newHeight2 = theHeight2 * 2;
		    	if (theIntro.length == 1) {
			    		currentSlide.prev('.an-intro').animate({left: '-10000px'}, 2000, 'easeInOutExpo');
			    		currentSlide.prev('.an-intro').fadeOut('fast');
			    		currentSlide.prev('.an-intro').find('img').animate({width: '200%', height: '200%'}, 3000);
			       		currentSlide.animate({left: '0px'}, 2000, 'easeInOutExpo');
	       				setTimeout(function(){
					   		currentSlide.find('img').animate({width: newWidth2, height: newHeight2}, 3000);
					   	}, 1500);
					   	clearInterval(theShow);
			    	} else {
			    		currentSlide.prev('.an-intro').animate({left: '-10000px'}, 2000, 'easeInOutExpo');
			    		currentSlide.prev('.an-intro').fadeOut('fast');
			    		currentSlide.prev('.an-intro').find('img').animate({width: '200%', height: '200%'}, 3000);
			       		currentSlide.animate({left: '0px'}, 2000, 'easeInOutExpo');
	       				setTimeout(function(){
					   		currentSlide.find('img').animate({width: newWidth2, height: newHeight2}, 3000);
					   	}, 1500);		
			        theIntro.splice(0,1);
			        }
	    	}, 5000);
    	}, 500);
    
    }, 10);*/
	
	var isThereNext = $('.next-image a').text();
	
	if (isThereNext == 'next photo'){} else {
		$('.next-image').css('display', 'none');
	}
	
	
	/*$('.an-intro').each(function(){
		var $thisSlide = $(this);
		setTimeout(function(){ 
			$thisSlide.animate({left: '0px'}, 'slow', 'easeOutBack', function(){
				$thisSlide.find('.intro-word').fadeIn('normal', function(){
					$thisSlide.animate({left: '-800px'}, 'slow', 'easeInBack');
				});
			});
		}, 5000);
	});*/
	
});
















