var nbLi = 0;

// CODE
function paneScrollTo(pIdDivScroll, pId) {
  var top = $('#'+pId).offset().top;
  $('#textes')[0].scrollTo(top)
}

function mycarousel_initCallback(carousel, state) {
  var objImg = $("#slider li:nth-child(1)").children();
  $("#title_h3").html(objImg[0].title);
  nbLi = $("#slider li").length;
};
function mycarousel_itemVisibleInCallbackAfterAnimation(carousel, item, idx, state) {
  $("#title_h3").html(item.firstElementChild.title);
};

$(document).ready(function($) {
  // SCROLL
  $('.scroll').jScrollPane({animateToInternalLinks:true, animateTo:true});

  // CAROUSEL
  $('#mycarousel').jcarousel({
  	wrap: 'circular',
  	scroll : 1,
		auto: 2
  });
  
  // PNG
  DD_belatedPNG.fix('.png');
  
  // PRETTYPHOTO
  $("a[rel^='prettyPhoto']").prettyPhoto();
  
  // SLIDER
 $('#slider').jcarousel({
  	wrap: 'circular',
  	scroll : 1,
		auto: 3.5,
		initCallback: mycarousel_initCallback,
		itemVisibleInCallback: {
      onAfterAnimation: mycarousel_itemVisibleInCallbackAfterAnimation
    }
  });
});

