$(document).ready(function() {
	
	// Drop Down Menu + Settings
	$("ul.sf-menu").superfish({ 
		animation: {height:'show'},   // slide-down effect without fade-in 
		delay:     1200               // 1.2 second delay on mouseout 
	}); 
	
		
	// Slider + Settings
	$('#slider').nivoSlider({
		controlNav: false,
		effect: 'fade'		
	});
	
	
	// Used for logo text effect -- see below
	$('#logo h1').append('<span class="hover"></span>');  
	$('#logo h1').css('background-position', '0 -170px');
	
	
	// Page Fade in effect	
	if($(".home").length != 0) {
		
		// If homepage, fade in logo, content, menu.
		$('#logo, .menu, #content').css({'opacity': '0'});
		
		$('#logo').animate({opacity: 1}, 1000);
		$('#content').animate({opacity: 1},1000);
		$('.menu').animate({opacity: 1}, 1000);
		
		// Used for logo red line slide effect
		$('#logo h1').append('<div class="mask"></div>');
		
		$('#logo h1 .mask').animate({'left': 1345}, 4000, 'easeOutSine' , function() {
			$('#logo h1 .mask').remove();	
		});
		$('#logo h1 span.hover').animate({ 'opacity': 1 }, 4000, 'easeInSine');
		
	} else {
		
		// Else only fade in content
		$('#content').css({'opacity' : '0'});
		$('#content').animate({opacity: 1},1000);
		
		// used for logo text effect
		$('#logo h1 span.hover').css('opacity', '1');
	}
	
	// Logo Text effect
	$('#logo h1').hover( function() {  
		 $('#logo h1 span.hover').stop().animate({  
			'opacity': 0  
			}, 700, 'easeOutSine')  
		},  
		function() {  
			$('.hover', this).stop().animate({  
				'opacity': 1  
			}, 700, 'easeOutSine')  
    });
	

});
