
$('.about a,a.cta').append('&nbsp;<span class="arrow">&#9654;</span>');


/* begin scrolly support */
function scrollSelect(selectedIndex) {
  var sections =$('#topSection .section');
  var infoBarSection=$('.infoBar .sectionBlock');

  sections.each(function(idx) {
    if (selectedIndex!=idx) {
      $(this).removeClass('selected');
      $(infoBarSection[idx]).removeClass('selected');
    } else {
      $(this).addClass('selected');
      $(infoBarSection[idx]).addClass('selected');
      $('.infoBar span').html($(this).children('img.main').attr('alt'));
    }
  });
}


var scrollActive = 1;
function scroller() {
  if (!scrollActive) return;

  var sections =$('#topSection .section');
  var selectedIndex = 0;
  sections.each(function(idx) {
    if ($(this).hasClass('selected'))selectedIndex=idx;
  });
  scrollSelect((selectedIndex+1)%sections.size())
}

function stopScroll() {
  var offset = Math.abs($(this).attr('offset'));
  scrollSelect(offset);
  scrollActive=false;
}


$('.infoBar .sectionBlock').click(stopScroll);
var scrollerInterval = window.setInterval(scroller, 6000);
/* end scrolly support */
