
      $(function() {
        $('#slideshow').cycle({
          fx:     'scrollLeft',  // effect
          speed:  900,    // speed of transition
          timeout: 14000,    // timeout of the slide
          pause:       false,     // true to enable "pause on hover"
          pauseOnPagerHover: false, // true to pause when hovering over pager link
          pager:  '#slideshownav',
          next:   '#slideshownext',
          prev:   '#slideshowprev',
          pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#slideshownav li:eq(' + (idx) + ') a';
          },
          after:update_slide_caption,
          before:fade_slide_caption,
          cleartypeNoBg: true,  // fix cleartype inside slides
          cleartype: true  // fix cleartype inside slides
        });
        $('#slideshownav li a').click(function() {   $('#slideshow').cycle('pause');   $('#button_pause').fadeOut(300); $('#button_play').fadeIn(200);   });
        $('.slide').click(function() {   $('#slideshow').cycle('pause'); 	$('#button_pause').fadeOut(300); $('#button_play').fadeIn(200);    });
        // $('.slide').mouseenter(function() {   $('#slideshow').cycle('pause'); 	$('#button_pause').fadeOut(200); $('#button_play').fadeIn(200);    });
        // $('.slide').mouseleave(function() {   $('#slideshow').cycle('resume'); $('#button_pause').fadeIn(200); $('#button_play').fadeOut(200);  });
        $('#roundabout li a').click(function() { $('#slideshow').cycle('pause'); $('#button_pause').fadeOut(300); $('#button_play').fadeIn(200);  });
        $('#pauseButton').click(function() {  $('#slideshow').cycle('pause'); $('#button_pause').fadeOut(300); $('#button_play').fadeIn(200);  });
        $('#resumeButton').click(function() {  $('#slideshow').cycle('resume'); $('#button_pause').fadeIn(200); $('#button_play').fadeOut(200);  });
      });
      fade_slide_caption = function(next, previous) {
        var caption_container;
        caption_container = $('#slideshowcaption')
        caption_container.fadeOut('fast')
      }
      update_slide_caption = function(next, previous) {   
        var caption;
        caption_container = $('#slideshowcaption')
        caption = $('span.slidecaption', previous)
        caption_container.fadeIn('fast')
        caption_container.html(caption.html())
      }

