var toggle_timeout = 5000;
var toggle_duration = 3000;

$(document).ready(function() {
	
	setInterval(toggle_splash, toggle_timeout);
	
});

function toggle_splash () {
	
	var splash_active = 0;
	var splash_count = 0;
	while ($('#splash_' + splash_count).length > 0) {		
		if ($('#splash_' + splash_count).css('display') != 'none')
			splash_active = splash_count;
		splash_count++;
	}
	
	if (splash_count < 2) return;
	
	var splash_next = (splash_active >= splash_count - 1)? 0: splash_active + 1;
	$('#splash_' + splash_active).fadeOut(toggle_duration);
	$('#splash_' + splash_next).fadeIn(toggle_duration);

}
