(function($){
  $(function(){
    // redirect to etnikart on every click in the event zone
    $('section.event > div').eq(0).click(function(){
      window.location = $(this).parent().data('redirect_url');
    });

    // temporary hover effect
//    $('section.event').hover(function() {
//      $('section.event > div').eq(1).stop(true, true).animate({
//        opacity: 0.2
//      }, 200);
//      $('section.event > div').eq(2).stop(true, true).animate({
//        opacity: 0.2
//      }, 200);
//    }, function (){
//      $('section.event > div').eq(1).stop(true, true).animate({
//        opacity: 1
//      }, 200);
//      $('section.event > div').eq(2).stop(true, true).animate({
//        opacity: 1
//      }, 200);
//    });
    
    // show legend on gallery image on hover
    $('.gallery_box').hover(function(){
      $('.titre_gallery', $(this)).stop(true, true).fadeIn(200);
    }, function(){
      $('.titre_gallery', $(this)).stop(true, true).fadeOut(200);
    });
    
    // fixed menu redirect
    $('.fixed_menu img').click(function() {
      window.location = $('.fixed_menu').data('redirect_url');
    });
    
    // scroll to config
    $('nav li').click(function(){
      var target = $(this).data("target");
      if (target) {
        $.scrollTo(target, 300, {
          offset : {
            top:-150
          }
        });
      }
    });

  });
})(jQuery);
