var total_splash = 0;
var curr_splash = 0;
var max_splash = 10;
var splash_time = 8000;
var splash_trans_time = 2000;
var interval;

$(document).ready(function() {
	interval = setInterval('change_splash();', splash_time);
	for (var i=0;i<max_splash;i++)
		if (jQuery('#splash'+i).length > 0)
			total_splash = i;
	total_splash++;
	for (var i=0;i<total_splash;i++)
		jQuery('#splash'+i).hide();
	jQuery('#splash0').show();
});

function change_splash(){
	jQuery('#splash'+curr_splash).fadeOut(splash_trans_time);
	curr_splash = (curr_splash + 1) % total_splash;
	jQuery('#splash'+curr_splash).fadeIn(splash_trans_time);
}

function activate_splash(splash_id){
	jQuery('#splash'+curr_splash).fadeOut(splash_trans_time);
	curr_splash = splash_id;
	jQuery('#splash'+splash_id).fadeIn(splash_trans_time);
	clearInterval(interval);
	interval = setInterval('change_splash();', splash_time);
	return false;
}
