var t;

// Show Latest 1
function showLatest1() {
	clearTimeout(t);

	$('#latestPosts').css("background-position", "0px 0px");

	$('#latestLink1').addClass('latestActive');
	$('#latestLink2').removeClass('latestActive');
	$('#latestLink3').removeClass('latestActive');
	$('#latestLink4').removeClass('latestActive');
	$('#latestLink5').removeClass('latestActive');

	$('#latestPhoto1').fadeIn('fast');
	$('#latestPhoto2').fadeOut('fast');
	$('#latestPhoto3').fadeOut('fast');
	$('#latestPhoto4').fadeOut('fast');
	$('#latestPhoto5').fadeOut('fast');

	t=setTimeout("showLatest2()", 3200);
}

// Show Latest 2
function showLatest2() {
	clearTimeout(t);

	$('#latestPosts').css("background-position", "0px 74px");

	$('#latestLink1').removeClass('latestActive');
	$('#latestLink2').addClass('latestActive');
	$('#latestLink3').removeClass('latestActive');
	$('#latestLink4').removeClass('latestActive');
	$('#latestLink5').removeClass('latestActive');

	$('#latestPhoto1').fadeOut('fast');
	$('#latestPhoto2').fadeIn('fast');
	$('#latestPhoto3').fadeOut('fast');
	$('#latestPhoto4').fadeOut('fast');
	$('#latestPhoto5').fadeOut('fast');

	t=setTimeout("showLatest3()", 3200);
}

// Show Latest 3
function showLatest3() {
	clearTimeout(t);

	$('#latestPosts').css("background-position", "0px 148px");

	$('#latestLink1').removeClass('latestActive');
	$('#latestLink2').removeClass('latestActive');
	$('#latestLink3').addClass('latestActive');
	$('#latestLink4').removeClass('latestActive');
	$('#latestLink5').removeClass('latestActive');

	$('#latestPhoto1').fadeOut('fast');
	$('#latestPhoto2').fadeOut('fast');
	$('#latestPhoto3').fadeIn('fast');
	$('#latestPhoto4').fadeOut('fast');
	$('#latestPhoto5').fadeOut('fast');

	t=setTimeout("showLatest4()", 3200);
}

// Show Latest 4
function showLatest4() {
	clearTimeout(t);

	$('#latestPosts').css("background-position", "0px 222px");

	$('#latestLink1').removeClass('latestActive');
	$('#latestLink2').removeClass('latestActive');
	$('#latestLink3').removeClass('latestActive');
	$('#latestLink4').addClass('latestActive');
	$('#latestLink5').removeClass('latestActive');

	$('#latestPhoto1').fadeOut('fast');
	$('#latestPhoto2').fadeOut('fast');
	$('#latestPhoto3').fadeOut('fast');
	$('#latestPhoto4').fadeIn('fast');
	$('#latestPhoto5').fadeOut('fast');

	t=setTimeout("showLatest5()", 3200);
}

// Show Latest 5
function showLatest5() {
	clearTimeout(t);

	$('#latestPosts').css("background-position", "0px 296px");

	$('#latestLink1').removeClass('latestActive');
	$('#latestLink2').removeClass('latestActive');
	$('#latestLink3').removeClass('latestActive');
	$('#latestLink4').removeClass('latestActive');
	$('#latestLink5').addClass('latestActive');

	$('#latestPhoto1').fadeOut('fast');
	$('#latestPhoto2').fadeOut('fast');
	$('#latestPhoto3').fadeOut('fast');
	$('#latestPhoto4').fadeOut('fast');
	$('#latestPhoto5').fadeIn('fast');

	t=setTimeout("showLatest1()", 3200);
}

showLatest1();
