



// ---> fermeture/ouverture de bloc "detail" (BO)
$(document).ready(function(){
			$('#liste li').click(function(){
				var text = $(this).children('div');
				if(text.is(':hidden')){
					text.slideDown('500');
					$(this).children('span').html('fermer');
				}else{
					text.slideUp('300');						
					$(this).children('span').html('Voir détails');

				}
					
				
			 });
});


// --> Drop down menu
$(document).ready(function(){
 
	//$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
	
	$("ul.topnav li span").hover(function() { //When mouse is over...
		
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
 
		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});
 
		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
 
});

// ---> animation sur le Drop down menu
$(function(){
	$(".topnav li a").mouseover(function(){
				$(this).stop().animate({backgroundPosition: "0px -135px"},700)						 
	 });
	$(".topnav li a").mouseout(function(){
				$(this).stop().animate({backgroundPosition: "0px 0px"},700)						 
	 });
	
});


// --> bouton Back to top  (cf aussi dans css.css et  /img/backtotop0.png )
$(window).scroll(function() {
if($(window).scrollTop() == 0){
$('#scrollToTop').fadeOut("fast");
} else {
if($('#scrollToTop').length == 0){
$('body').append('<div id="scrollToTop">'+
'<a href="#"></a>'+
'</div>');
}
$('#scrollToTop').fadeIn("fast");
}
});
$('#scrollToTop a').live('click', function(event){
event.preventDefault();
$('html,body').animate({scrollTop: 0}, 'slow');
});


// --> navigation page produit  (cf aussi dans css.css )
	function goToByScroll(id){

      $('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');

}

$(document).ready(function(){
var navig = $("#navig_produit0");
if(navig.length>0){
navig.css({ opacity: 0.5 });
navig.hover(function(){
									$(this).css({ opacity: 1 });
									},
							function(){	
							$(this).css({ opacity: 0.5 });
							});
var posLeft = ($(document).width()/2)-(navig.width()/2);

navig.css({
		  left:posLeft
		  });
var detectBottom = $(document).height();
var posTop = navig.offset().top;

if(detectBottom<150){
navig.css({ opacity: 0 });
}else{
navig.css({ opacity: 0.5 });	
}
}
						   });






// ---> diaporama
$(document).ready(function() {
	$('#coin-coin').coinslider({
			 width: 392,
			 height: 300,
			 spw: 7, 
			 sph: 5, 
			 delay: 3000, 
			 sDelay: 30, 
			 opacity: 0.7, 
			 titleSpeed: 500, 
			 effect: 'straight', 
			 navigation: true, 
			 links : true, 
			 hoverPause: true 
			 });
		});
		
/* 		
PARAMETRES
width: 565, // width of slider panel
height: 290, // height of slider panel
spw: 7, // squares per width
sph: 5, // squares per height
delay: 3000, // delay between images in ms
sDelay: 30, // delay beetwen squares in ms
opacity: 0.7, // opacity of title and navigation
titleSpeed: 500, // speed of title appereance in ms
effect: '', // random, swirl, rain, straight
navigation: true, // prev next and buttons
links : true, // show images as links
hoverPause: true // pause on hover */
