var maxSplash=0;
var currentSplash=0;
var splashTimer;
var splashDelayTime=7000;
var splashTransitionTime=1500;

$(document).ready(function() {
  if((maxSplash=$('#splash li').length)>1) {
    $('#splash li').css({top:0,left:0}).not(':eq('+currentSplash+')').hide();
    splashTimer=setTimeout('nextSplash()',splashDelayTime);
  }
});

function nextSplash() {
  var n=currentSplash+1;
  if(n>=maxSplash)
    n=0;
  var target=$('#splash li').eq(currentSplash);
  var nTarget=$('#splash li').eq(n);
  
  target.css('z-index','98');
  nTarget.css('z-index','99');
  
  $('.tag',nTarget).css('bottom','-20px').animate({bottom:0},{duration:splashTransitionTime*2,easing:'easeOutQuart'});
  nTarget.stop().fadeIn({duration:splashTransitionTime,
                         easing:'easeOutSine',
                         complete:function() {
                           target.stop().hide();
                           currentSplash=n;
                         }
                        });
  
  splashTimer=setTimeout('nextSplash()',splashDelayTime);
}