Slideshow JavaScript: Initialization

  var slideshowList = document.getElementsByClassName('paragraph--type--manual-slide-show');

  /* Process each Slideshow Instance */
  for (var set = 0; set < slideshowList.length; set++) {

    var showTitle = slideshowList[set].children[0];
    var showSlides = slideshowList[set].children[1];

    showTitle.id = 'gtSlideshowTitle_' + set;

    /* Mark the slide show slides for easy access */
    showSlides.id = 'gtSlideshowSet_' + set;
    /* Set up the data variable pointing to the current slide */
    showSlides.setAttribute('data-current-slide', 0);
    /* Map the heading title to the slideshow */
    showSlides.setAttribute('aria-labelledby', 'gtSlideshowTitle_' + set);

    /* Set IDs on slide panels and hide all panels except for the first one */
    for (var slide = 0; slide < showSlides.children.length; slide++) {
      var slidePanel = showSlides.children[slide];
      slidePanel.id = 'gtSlideshowSlide_' + set + '_' + slide;
      if (slide > 0) {
        slidePanel.style.display = 'none';
      }
    }

    /* Add controls below the slides */
    gtJSUI_generateControlBar(slideshowList[set], set, showSlides.children.length);

  }