function init_gallery_zoom() {
  var images = $(".other-view");
  var index_max = images.size()-1
  var left_arrow = $('#previousButton');
  var right_arrow = $('#nextButton');
  var left_arrow_img = 'url(/ui/ecox/images/product/leftarrow-unable.png)'
  var right_arrow_img = 'url(/ui/ecox/images/product/rightarrow-unable.png)'

  images.eq(0).addClass('selected');
  $(".boite").hover(function(){
      $(this).children(".hoverable").addClass("hover");
    },function(){
      $(this).children(".hoverable").removeClass("hover");
    });

  /* navigation buttons */
  left_arrow.css('background-image', left_arrow_img)
  if(index_max < 3)
    right_arrow.css('background-image', right_arrow_img)


  /* Thumbnails */
  var current_image = 0;
  $("#thumb-block .other-view").click(function(event) {
      var index_img = $("#thumb-block .other-view").index(this);
      deplace_to_image(index_img);
  });

  $("#nextButton").click(function(event){
    nb_images = $(".other-view").size()
    if(current_image < index_max)
      deplace_to_image(current_image+1);
  });

  $("#previousButton").click(function(event){
    if(current_image)
      deplace_to_image(current_image-1);
  });

  function deplace_to_image(index_img){
    // Get some informations
    var image_width = 69;
    var nb_images = images.size()
    var new_pos = 0;

    // Calcul deplacement
    if(index_img>=2){
        new_pos = (1 - index_img) * image_width;
    }
    if (index_img>=2 && index_img>=nb_images-2){
        new_pos = -((nb_images-3) * image_width);
    }

    // to restore arrows states
    if(!current_image)
      left_arrow.css('background-image', '')
    if(current_image == index_max)
      right_arrow.css('background-image', '')

    // Move picture with animation
    $('#thumb-images').animate({left: new_pos}, 500);

    // Set image as current image
    current_image = index_img

    // to set arrows states
    if(current_image == index_max)
      right_arrow.css('background-image', right_arrow_img)
    if(!current_image)
      left_arrow.css('background-image', left_arrow_img)

    // Remove css selected.
    images.removeClass('selected');

    // Get selected image
    image_selected = images.eq(index_img)

    // Add css selected to current img
    image_selected.addClass('selected');

    // Show image
    var img = image_selected.children('.wrapper').children("img");
    var new_src = img.attr("src");
    new_src = new_src.replace("width=58", "width=209");
    new_src = new_src.replace("height=60", "height=146");
    $("img.big").attr("src", new_src);

    // Update zoom link max_size for 1024
    var new_dnl = img.attr("src");
    new_dnl = new_dnl.replace(/;.*$/, ';thumb?width=990&height=580');
    $("#zoom").attr("href", new_dnl);
  }

  $("a#zoom").lightBox();

}
