/*function fixShortWidth()
{
	if ($(window).width() < 1600)
	{
		$('body').addClass('shortWidth');
	}
	else
	{
		$('body').removeClass('shortWidth');
	}
}*/

function animPage()
{
	//fixShortWidth();

	$('#title').stop(true, false);
	$('#title').css('top', -500);
	$('.subtitle-part').each(function(index, element)
	{
		$(element).stop(true, false);
		clearTimeout($(element).animTimer);

		$(element).css('color', '#101010');
	});
	$('h1, li').each(function(index, element)
	{
		$(element).stop(true, false);
		clearTimeout($(element).animTimer);

		$(element).css('right', $(window).width());
	});

	$('#title').animate({ top: 0 }, 1000, 'easeOutBounce', function()
	{
		$('.subtitle-part').each(function(index, element)
		{
			$(element).animTimer = setTimeout(function() { $(element).animate({ color: 'white' }, 2000, 'linear'); }, 500 + 700 * index);
		});

		$('h1, li').each(function(index, element)
		{
			$(element).animTimer = setTimeout(function() { $(element).animate({ right: 0 }, 500, 'easeOutBack'); }, 3500 + 100 * index);
		});
	});
};

$(document).ready(function()
{
	Cufon.replace('#title-part1', { fontFamily: 'GFX47_Arcade', textShadow: '5px 5px #909090' });
	Cufon.replace('#title-part2', { fontFamily: 'GFX47_Arcade' });
	Cufon.replace('h1', { fontFamily: 'GFX47_Arcade', textShadow: '1px 1px white' });

	animPage();
});

