/**
 * Start the Auto-rotating of the Tab Component
 *
 * This JavaScript uses the "Tab Autoplay" jquery function that adds the
 * auto-play functionality to the tab component.
 *
 * @author Ben Barber (bbarber@i2rd.com)
 * @require jquery-tab-autoplay.js, tab-container.js, cms-tab-effects.js
 */
(function($){

  // Register Tab Container transition effects.
  $.extend(cms.TabContainer.prototype, cms.TabContainer.Effects.FadeBlend);

  // When page loads,
  $(function(){
    // Initialize auto-play
    var player = $("#hero_slider").autoplay({
      autoScrollSpeed : 9500,
      useNumbers : false, // Use [1] [2] [3] instead of the tab name
      addControls : false // Adds the play/pause buttons
    });
    // Wrap the controls for CSS convenience.
    $("div.tab-items").not("ul.tab-items").wrapAll('<div class="controls_wrapper"></div>');
  });

})(jQuery);
