$(document).ready(function(){
	var delay = 2500;
	
	
	$('html, body').css({
		'background':'#000'
	});
	$('nav ul').hide();
	$('header > *').each(function() {
		var first, sub, s = $(this).html();
		first = s.charAt(0);
		sub = s.substring(1);
		$(this).html(first + '<span>' + sub + '</span>').children('span').hide();
		$(this).css({
			'font-size':730,
			'float':'left',
			'position':'relative',
			'left':120,
			'color':'rgba(255,255,255,1)'
		}).hide().fadeIn(delay*0.3);
	});
	
	if ($('body').is('.single, .page, .archive')) {
	}
	
	
	// Index fade in animation
if ($('body').is('.home')) {
	$('header > *').delay(delay*.30).ready(function(){
		$('header > *:first-child').animate({
			'font-size':324 + 'px',
			'left':0,
		},delay*.75, function() { 
				$(this).removeAttr('style').children('span').removeAttr('style');
		}).children('span').css('position','absolute').delay(delay*1.3).fadeIn(delay*.75);
		
		$('header > *:last-child').animate({
			'font-size':213 + 'px',
			'left':-155,
			'top':275
		}, delay*.75, function() {
				$(this).removeAttr('style').children('span').removeAttr('style');
				$('html, body').removeAttr('style');
				$('nav ul').show();
		}).children('span').css('position','absolute').delay(delay*1.3).fadeIn(delay*.75);
	});
} else {
	$('header > *').removeAttr('style').children('span').removeAttr('style').show();
	$('html, body').css({
		'background': '#FFF'
	});
	$('nav ul').removeAttr('style').append('<li></li>');
}
	
});

