
/*permet de charger le scroll du guide*/
$(window).load(function() { 
	ThumbnailScroller("tsh_container","horizontal",30,800,"easeOutCirc",0.5,300);
});

$(document).ready(
	function(){
		function megaHoverOver(){
			$(this).find(".sub").stop().fadeTo('fast', 1).show();
		}
		function megaHoverOut(){ 
		  $(this).find(".sub").stop().fadeTo('fast', 0, function() {
			  $(this).hide(); 
		  });
		} 
		var config = {
			 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
			 interval: 10, // number = milliseconds for onMouseOver polling interval    
			 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
			 timeout: 10, // number = milliseconds delay before onMouseOut    
			 out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
		}; 
		
		$("ul.menu1 li").hoverIntent(config);  
		$("#bubble1").hover(
			function(){
				$("#bubble1").next(".forumboxbubble").show();
			},function(){
				$("#bubble1").next(".forumboxbubble").hide();
			}
		);	
		
		$("#bubble2").hover(
			function(){
				$("#bubble2").next(".forumboxbubble").show();
			},function(){
				$("#bubble2").next(".forumboxbubble").hide();
			}
		);
		
		$("#bubble3").hover(
			function(){
				$("#bubble3").next(".forumboxbubble").show();
			},function(){
				$("#bubble3").next(".forumboxbubble").hide();
			}
		);
		
		$("#bubble4").hover(
			function(){
				$("#bubble4").next(".forumboxbubble").show();
			},function(){
				$("#bubble4").next(".forumboxbubble").hide();
			}
		);
		
		$("#bubble5").hover(
			function(){
				$("#bubble5").next(".forumboxbubble2").show();
			},function(){
				$("#bubble5").next(".forumboxbubble2").hide();
			}
		);    
		
		$("#bubble6").hover(
			function(){
			   $("#bubble6").next(".forumboxbubble2").show();
			 },function(){
			   $("#bubble6").next(".forumboxbubble2").hide();
			}
		);
		
	$("#topforuma").hover(function(){ 
		$('.exchangera').removeClass('exchangeraactive');
		$(this).addClass("exchangeraactive"); 
		$('#exchangerforum').show();
		$('#exchangertopproduit').hide();
		$('#exchangerarticle').hide();
		$('#exchangertestimony').hide();
	});

	$("#toparticlea").hover(function(){ 
		$('.exchangera').removeClass('exchangeraactive');
		$(this).addClass("exchangeraactive"); 
		$('#exchangerforum').hide();
		$('#exchangertopproduit').hide();
		$('#exchangerarticle').show();
		$('#exchangertestimony').hide();
	});

	$("#topproducta").hover(function(){ 
		$('.exchangera').removeClass('exchangeraactive');
		$(this).addClass("exchangeraactive"); 
		$('#exchangerforum').hide();
		$('#exchangertopproduit').show();
		$('#exchangerarticle').hide();
		$('#exchangertestimony').hide();
	}); 

	$("#toptestimonya").hover(function(){ 
		$('.exchangera').removeClass('exchangeraactive');
		$(this).addClass("exchangeraactive"); 
		$('#exchangerforum').hide();
		$('#exchangertopproduit').hide();
		$('#exchangerarticle').hide();
		$('#exchangertestimony').show();
	}); 

	}
);
	
	var theInt = null;
	var $crosslink, $navthumb;
	var curclicked = 0;
		
	theInterval = function(cur){
		clearInterval(theInt);
			
		if( typeof cur != 'undefined' )
			curclicked = cur;
			
		$crosslink.removeClass("active-thumb");
		$navthumb.eq(curclicked).parent().addClass("active-thumb");
			$(".stripNav ul li a").eq(curclicked).trigger('click');

			
		theInt = setInterval(function(){
			$crosslink.removeClass("active-thumb");
			$navthumb.eq(curclicked).parent().addClass("active-thumb");
			$(".stripNav ul li a").eq(curclicked).trigger('click');

			curclicked++;
			if( 13 == curclicked )
				curclicked = 0;
				
		}, 6000);
	};
		
	$(function(){
			
		$("#main-photo-slider").codaSlider();
			
		$navthumb = $(".nav-thumb");
		$crosslink = $(".cross-link");
			
		$navthumb.click(function() {
			var $this = $(this);
			theInterval($this.parent().attr('href').slice(1) - 1)
			return false;
		});
			
		theInterval();
	});
