/*
jQuery(document).ready(function() {
  jQuery('#slider').nivoSlider({
    prevText: 'Volgende',
    nextText: 'Vorige',
    pauseTime: 5000,
    captionOpacity: 1,
    effect: 'fade'
  });
});
*/

(function ($) {
  $(document).ready(function() {
    $('#slider').nivoSlider({
      prevText: 'Volgende',
      nextText: 'Vorige',
      pauseTime: 5000,
      captionOpacity: 1,
      effect: 'fade'
    });

    $('.field-type-image a').each(function(i, e) {
      switch_background_color(e);
    });
  });

  function switch_background_color(sourceElement) {
    $(sourceElement).hover(
      function(){
        var img = $(sourceElement).children('img');
        var color = getDominantColor(img);
        $(sourceElement).css('box-shadow', '1px 1px 6px rgba(' + color.r + ', ' + color.g + ', ' + color.b + ', 1)');
      },
      function () {
        $(sourceElement).css('box-shadow', '1px 1px 2px #949494');
      }
    );
  }
}(jQuery));
;

