$(document).ready(function() {
						   
						   
// EFFET ANCRES
  if ($('a[href*=#]').length) {
    $('a[href*=#]').click(function() {
      var $target = $(this.hash);
      $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
	  var cible = $target.offset().top - $('h2').eq(0).offset().top + 30; /* reference + ajustement hauteur */
      $('html, body').animate({ scrollTop: cible },1000); /* div ou html,body par defaut */
      return false;
    })
  }
// EFFET ANCRES



	//Examples of how to assign the ColorBox event to elements.
	// popup zoom
	$(".slideshow, .imgnews").colorbox
	(
		{
			slideshow:false, 
			transition:"fade", 
			slideshowSpeed:6000, 
			speed:800, 
			iframe:true, 
			opacity:0.4,
			preloading:true,
			width:"684px", 
			height:"550px", 
			
			previous : "précédent",
			next : "suivant",
			close : "fermer",
			slideshowStart: "démarrer le diaporama",
			slideshowStop: "arrêter le diaporama",
			current : "image {current} sur {total}"
		},
		// taille iframe auto colobox
		function () 
		{
			$('#cboxIframe').ready(function() 
			{ 			
				var w = $('#cboxIframe').contents().find('#imgzoompopup').width();
				var h = $('#cboxIframe').contents().find('#imgzoompopup').height();

				if ((!h) || (!w))
					return true;
				// taille iframe auto colobox
				$(' #colorbox, #cboxContent, #cboxWrapper, #cboxLoadedContent').width(w + 16);
				$(' #colorbox, #cboxContent, #cboxWrapper, #cboxLoadedContent').height(h + 48);
				
				$('#colorbox').css('left', ($(document).width() - $('#cboxContent').width()) / 2 + 'px');
				//$('#colorbox').css('top', ($(document).height() - $('#cboxContent').height()) / 2 + 'px');
			});
		}	
	);
	
	
});


