function doAfter(currSlideElement, nextSlideElement, options, forwardFlag) {
  //console.log("After! slide is " + currSlideElement.id + " and next is " + nextSlideElement.id);


  if(nextSlideElement.id == "slide-ooh") {
    animateFrogSlide();
  }

  if(nextSlideElement.id == "slide-one") {
    $('#slideshowOverlayBottom4').css("opacity", "0.0");
    animateSlideTwo();
  }

  if(nextSlideElement.id == "slide-two") {
    $('#slideshowOverlayBottom2').css("opacity", "0.0");
    animateLogoSlide();
  }

  if(nextSlideElement.id == "slide-three") {
    /* Reset the frog slide */
    $('#frame1Z').css("opacity", "1.0");
    $('#frame2Z').css("opacity", "0.0");
    $('#frame3Z').css("opacity", "0.0");
    $('#frame4Z').css("opacity", "0.0");
    $('#frame5Z').css("opacity", "0.0");
    $('#frame6Z').css("opacity", "0.0");
    $('#Slide1TextBottom').css("opacity", "0.0");
    $('#Slide1TextBottom').css("marginLeft", "-700px");

    animateSlideFour();
  }

  if(currSlideElement.id == "slide-three") {
    /* Reset the logo slide */
    $('#frame1A').css("opacity", "1.0");
    $('#frame2A').css("opacity", "0.0");
    $('#frame3A').css("opacity", "0.0");
    $('#frame4A').css("opacity", "0.0");
    $('#frame5A').css("opacity", "0.0");

    $('#frame1B').css("opacity", "1.0");
    $('#frame2B').css("opacity", "0.0");
    $('#frame3B').css("opacity", "0.0");
    $('#frame4B').css("opacity", "0.0");
    $('#frame5B').css("opacity", "0.0");
    $('#frame6B').css("opacity", "0.0");

    $('#Slide2TextBottom').css("opacity", "0.0");

  }

}

$slideshow = {
    context: false,
    tabs: false,
    timeout: 11000,      // time before next slide appears (in ms)
    slideSpeed: 1000,   // time it takes to slide in each slide (in ms)
    tabSpeed: 300,      // time it takes to slide in each slide (in ms) when clicking through tabs
    fx: 'scrollHorz',   // the slide effect to use
    rev: 1,

    init: function() {
        // set the context to help speed up selectors/improve performance
        this.context = $('#slideshow');

        // set tabs to current hard coded navigation items
        this.tabs = $('ul.slides-nav li', this.context);

        // remove hard coded navigation items from DOM
        // because they aren't hooked up to jQuery cycle
        this.tabs.remove();

        // prepare slideshow and jQuery cycle tabs
        this.prepareSlideshow();
    },

    prepareSlideshow: function() {
        // initialise the jquery cycle plugin -
        // for information on the options set below go to:
        // http://malsup.com/jquery/cycle/options.html
        $('div.slides > ul', $slideshow.context).cycle({
            fx: $slideshow.fx,
            timeout: $slideshow.timeout,
            speed: $slideshow.slideSpeed,
            fastOnEvent: $slideshow.tabSpeed,
            pager: $('ul.slides-nav', $slideshow.context),
            pagerAnchorBuilder: $slideshow.prepareTabs,
            before: $slideshow.activateTab,
            pauseOnPagerHover: false,
            pause: false,
            noWrap: true,
            after: doAfter,
            next: '#rightArrow',
            prev: '#leftArrow',
            startingSlide: 0,
            rev: 1
        });
    },

    prepareTabs: function(i, slide) {
        // return markup from hardcoded tabs for use as jQuery cycle tabs
        // (attaches necessary jQuery cycle events to tabs)
        return $slideshow.tabs.eq(i);
    },

    activateTab: function(currentSlide, nextSlide) {
        // get the active tab
        var activeTab = $('a[href="#' + nextSlide.id + '"]', $slideshow.context);

        // if there is an active tab
        if(activeTab.length) {
            // remove active styling from all other tabs
            $slideshow.tabs.removeClass('on');

            // add active styling to active button
            activeTab.parent().addClass('on');
        }
    }
};


jQuery(function() {
  // add a 'js' class to the body
  jQuery('body').addClass('js');

  // initialise the slideshow when the DOM is ready
  $('#slideshowB').click(function() {
    window.location='/our-clients-portfolio';
  });

  $('#slideshowB').hover(function() {
    $(this).css("cursor", "pointer");
  }, function() {
    $(this).css("cursor", "default");
  });

  $slideshow.init();
  animateFrogSlide();

});
