/**
 * @package    Church Resources
 * @subpackage View
 * @author     Stephen Callaghan
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 * @updated    13/07/2011
 */

function tagSwitch() {
  var $active = $('#homebannerbottom p.active');

  if ( $active.length == 0 ) $active = $('#homebannerbottom p:last');

  var $next =  $active.next().length ? $active.next()
    : $('#homebannerbottom p:first');

  $active.addClass('last-active')
    .css({opacity: 1.0})
    .animate({opacity: 0});

  $next.css({opacity: 0})
    .addClass('active')
    .animate({opacity: 1.0}, 1500, function() {
        $active.removeClass('active last-active');
    });
}

$(document).ready(function() {
  $(function() {
    $('#homebannerbottom p.last-active').animate({opacity: 0});
    setInterval( "tagSwitch()", 20000 );
  });
});

