$(document).ready(function() {
  // NEWS
  $("#featured").tabs().tabs("rotate", 5000, true);
  $("#featured").tabs({event: "mouseover"});
  $("#featured").hover(
  function() {
  $("#featured").tabs("rotate",0,true);
  },
  function() {
  $("#featured").tabs("rotate",5000,true);
  }
  );

  // DOCS A TELECHARGER
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active");
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
    
		return false;
	});
  
  // ACCES RAPIDE
  $(function() {
  $("#acces span").css("opacity","0");
  });

  $(function() {
  $("ul.iacces span").css("opacity","0");
  });

  $("ul.iacces a span").hover(function() { 
  $(this).stop().animate({"opacity": 1}); 
  },function() { 
  $(this).stop().animate({"opacity": 0}); 
  });
  
  // TO TOP
  $("#bhau").click(function(){
			$('html, body').animate({scrollTop:0}, 1000, 'linear');
			return false;
  })
  
  $(function() {
  $("#bhau span").css("opacity","0");
  });
  $(function() {
    $("#btctc span").css("opacity","0");
  });
  $(function() {
    $("#bthom span").css("opacity","0");
  });
  
  $("#bhau span").hover(function() { 
  $(this).stop().animate({"opacity": 1}); 
  },function() { 
  $(this).stop().animate({"opacity": 0}); 
  });
  $("#bthom span").hover(function() { 
  $(this).stop().animate({"opacity": 1}); 
  },function() { 
  $(this).stop().animate({"opacity": 0}); 
  });
  $("a#btctc span").hover(function() { 
  $(this).stop().animate({"opacity": 1}); 
  },function() { 
  $(this).stop().animate({"opacity": 0}); 
  });
  
  // PDP
  $("#footer a").hover(function() { 
  $(this).stop().animate({"color": "#fff"},"fast"); 
  },function() { 
  $(this).stop().animate({"color": "#a7a7a7"},"fast"); 
  });
  $("#ppctc a").hover(function() { 
  $(this).stop().animate({"color": "#fff"},"fast"); 
  },function() { 
  $(this).stop().animate({"color": "#9bd72c"},"fast"); 
  });
});
