function setTopstory(cur_id, next_id) {
	$('.topstory_'+cur_id).fadeTo(1250, 0);
	$('.topstory_'+cur_id).css('z-index', 0);
	
	$('.topstory_'+next_id).fadeTo(1250, 1);
	$('.topstory_'+next_id).css('z-index', 3);
}


$(document).ready(function() {
	// First index
	var index = 0;
	
	// Hide all topstories
	$('.topstory').css('opacity', 0);
	// .. except for the first one.
	$('.topstory_' + index).css('opacity', 1);
	$('.topstory_' + index).css('z-index', 3);

	// Amount of topstories
	var amount = $('.topstory').length;
	
	// Do timerly functions
	$.timer(7000, function (timer) {
		var next_id = ((index + 1) == amount) ? 0 : (index + 1);
		setTopstory(index, next_id);
		index = next_id;
	});
});
