function sloganSwitch() {
    var $active = $('#slogans li.active');
    if ( $active.length == 0 ) $active = $('#slogans li:last');
    var $next =  $active.next().length ? $active.next() : $('#slogans li:first');

    $active.animate({ width: '0', opacity:0 }, 1, function(){
      $next.animate({ width: '510', opacity:1 }, 2000).addClass('active');
    }).removeClass('active');

}

$(function() {
  if($('#slogans li').length > 1){
    $('#slogans li').css({width:0, opacity:0});
    sloganSwitch();
    setInterval( "sloganSwitch()", 4500 );
  } else {
    $('#slogans li').css({ width: '510', opacity:1 }).show();
  }
});

