jQuery(document).ready(function() {
    //Carousel
    jQuery('#mycarousel').jcarousel({
        auto: 2,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
  
    //Externe links openen in nieuw venster
    $("a[href^='http']").attr('target','_blank');
});

function mycarousel_initCallback(carousel)
{
  // Disable autoscrolling if the user clicks the prev or next button.
  carousel.buttonNext.bind('click', function() {
      carousel.startAuto(0);
  });

  carousel.buttonPrev.bind('click', function() {
      carousel.startAuto(0);
  });

  // Pause autoscrolling if the user moves with the cursor over the clip.
  carousel.clip.hover(function() {
      carousel.stopAuto();
  }, function() {
      carousel.startAuto();
  });
};

/* Highslide */
hs.graphicsDir = '/scripts/highslide/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.fadeInOut = true;
hs.dimmingOpacity = 0.8;
hs.outlineType = '';
hs.captionEval = 'this.thumb.alt';
hs.marginBottom = 105 // make room for the thumbstrip and the controls
hs.numberPosition = 'caption';

// Add the slideshow providing the controlbar and the thumbstrip
var carouselOptions = {
  slideshowGroup: 'carousel',
  wrapperClassName: 'dark',
  //outlineType: 'glossy-dark',
  dimmingOpacity: 0.8,
  align: 'center',
  transitions: ['expand', 'crossfade'],
  fadeInOut: true,
  wrapperClassName: 'borderless floating-caption',
  marginLeft: 100,
  marginBottom: 80,
  numberPosition: 'caption'
};

if (hs.addSlideshow) 
  hs.addSlideshow({
    slideshowGroup: 'carousel',
    interval: 5000,
    repeat: true,
    useControls: true,
    overlayOptions: {
      className: 'text-controls',
    position: 'bottom center',
    relativeTo: 'viewport',
    offsetY: -60
  },
  thumbstrip: {
    position: 'bottom center',
    mode: 'horizontal',
    relativeTo: 'viewport'
  }
});

var galleryVaantjeOptions = {
  slideshowGroup: 'galleryVaantje',
  wrapperClassName: 'dark',
  //outlineType: 'glossy-dark',
  dimmingOpacity: 0.8,
  align: 'center',
  transitions: ['expand', 'crossfade'],
  fadeInOut: true,
  wrapperClassName: 'borderless floating-caption',
  marginLeft: 100,
  marginBottom: 80,
  numberPosition: 'caption'
};

if (hs.addSlideshow)
  hs.addSlideshow({
    slideshowGroup: 'galleryVaantje',
    interval: 5000,
    repeat: true,
    useControls: true,
    overlayOptions: {
      className: 'text-controls',
    position: 'bottom center',
    relativeTo: 'viewport',
    offsetY: -60
  },
  thumbstrip: {
    position: 'bottom center',
    mode: 'horizontal',
    relativeTo: 'viewport'
  }
});

var galleryRechtsOptions = {
  slideshowGroup: 'galleryRechts',
  wrapperClassName: 'dark',
  //outlineType: 'glossy-dark',
  dimmingOpacity: 0.8,
  align: 'center',
  transitions: ['expand', 'crossfade'],
  fadeInOut: true,
  wrapperClassName: 'borderless floating-caption',
  marginLeft: 100,
  marginBottom: 80,
  numberPosition: 'caption'
};

if (hs.addSlideshow)
  hs.addSlideshow({
    slideshowGroup: 'galleryRechts',
    interval: 5000,
    repeat: true,
    useControls: true,
    overlayOptions: {
      className: 'text-controls',
    position: 'bottom center',
    relativeTo: 'viewport',
    offsetY: -60
  },
  thumbstrip: {
    position: 'bottom center',
    mode: 'horizontal',
    relativeTo: 'viewport'
  }
});

