$(document).ready(function()
{
	var featureID = 0;
	var featureTimer = null;
	var featureTime = 4000;
	var cycleFeatureImage = function()
	{
		featureID++;
		if(featureID > 3)
			featureID = 1;

		var img = 'url("img/feature_' + featureID + '.jpg")';
		//$('#featureGame').animate({opacity: 0}, featureTime/20, function(){
			$('#featureGame').css('background-image',img);
		//}).animate({opacity: 1}, featureTime/20);
		
		$('#featureSliderButton').attr('src','img/feature_slider_' + featureID + '.png');
		
		clearTimeout(featureTimer);
		featureTimer = setTimeout(function()
		{
			cycleFeatureImage()
		},featureTime);
	};
	
	cycleFeatureImage();

	$('#featureMoreInfo').click(function()
	{
		window.location.href = $('#featureID' + featureID).text() + '.html';
	});

	$('#featureSliderButton').click(function()
	{
		cycleFeatureImage();
	});
	
	// NAVIGATION
	$('#mainLogo').click(function()
	{
		window.location.href = 'index.html';
	});	
	
	$('#footerLogo').click(function()
	{
		window.location.href = 'index.html';
	});
	
	$('#mainHomeButton').click(function()
	{
		window.location.href = 'index.html';
	});
	
	$('#mainGamesButton').click(function()
	{
		window.location.href = 'games.html';
	});
	
	$('#mainKitsButton').click(function()
	{
		window.location.href = 'kits.html';
	});
	
	$('#mainContactButton').click(function()
	{
		window.location.href = 'contact.html';
	});
	
	$('.otherGame').click(function()
	{
		window.location.href = $(this).attr('id') + '.html';
	});
});
