$(function(){
	//Menu déroulant
	$('ul.ul_menu_menuniveau1').addClass('jd_menu');
	$('ul.ul_menu_menuniveau1').jdMenu();
	
	//Lien pour nouvelle page
	$("a[class^='_blank']").click(function(){
		window.open(this.href, '_blank');
		return false;
    });
	
	//Fermer la popup accueil
	$('#fermer_popup').click(function(){
		$('#bloc_popup').css('display','none');
    });
	if ($('#bloc_popup').length){
		$('#bloc_popup').css('height',jQuery(document).height());
	};
	//Effet opacite au hover
	$('.opacityOut').hover(
		function(){$(this).stop().animate({opacity: 1}, 300);},
		function(){$(this).stop().animate({opacity: 0.70}, 300);
	});
	
	//Diaporama accueil
	if( $('.slideTab').size() > 1 ){
		//$('a#select-0').addClass('enable');
		$('.slideTab').tabSwitch('create', {type: 'slide', height: 369, width: 753});
		
		$('.navTab').click(function(){
			$('.slideTab').tabSwitch('moveStep',{step: parseInt($(this).attr('rel'))});
		});
		
		$('.slideTab').tabSwitch('startAuto',{
			interval: 10000
		}, function(){
			var index = $('.slideTab').tabSwitch('index');
			$('li.legend').removeClass('enable');
			$('li#tab-'+index).addClass('enable');
		});
	}
	//Défilement horizontal
	$('#scrollImage').capcarousel({
		flecheControle: false,
		vitesse_rafraichisement: 100,
		fade: false,
		acceleration_logarithmique: false,
		vitesse_max: 6
	});
});
