// JavaScript Document

//clignotement abonnement 
$(document).ready(function(){				
	$("#abonnement").mouseover(function(){ 	clearInterval(control); });
	$("#abonnement").mouseout(function(){
		control = setInterval("$('#abonnement').fadeOut(900);$('#abonnement').fadeIn(900);",3000);
	});

	$("#htBoutVIP").mouseover(function(){ 	clearInterval(control); });
	$("#htBoutVIP").mouseout(function(){
		control = setInterval("$('#htBoutVIP').fadeOut(900);$('#htBoutVIP').fadeIn(900);",3000);
	});
});

$(function(){
control = setInterval("$('#abonnement').fadeOut(900);$('#abonnement').fadeIn(900);",3000);
control = setInterval("$('#htBoutVIP').fadeOut(900);$('#htBoutVIP').fadeIn(900);",3000);
});

// bouton menu
$(document).ready(function() {
	$("#menu li").mouseover(function(){
	  $(this).animate({"top": "-=10px"}, 100).animate({"top": "+=10px"}, 600);
	});
});

// FANCYBOX
$(document).ready(function() {
	$("a.VideoPlayer").fancybox({
		'width'				: 420,
		'height'			: 450,
		'padding'			: 0,
		'margin'			: 0,
		'centerOnScroll'	: true,
		'overlayShow'		: false,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});

	$("a.SonPlayer").fancybox({
		'width'				: 350,
		'height'			: 120,
		'padding'			: 0,
		'margin'			: 0,
		'centerOnScroll'	: true,
		'overlayShow'		: false,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$("a.PhotoPlayer").fancybox({
		'width'				: 618,
		'height'			: 548,
		'padding'			: 0,
		'margin'			: 0,
		'centerOnScroll'	: true,
		'overlayShow'		: false,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$("a.EnvoiAmi").fancybox({
		'width'				: 400,
		'height'			: 300,
		'padding'			: 0,
		'margin'			: 0,
		'centerOnScroll'	: true,
		'overlayShow'		: false,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
});

// NEWS ROTATOR
 var headline_count;
 var headline_interval;
 var old_headline = 0;
 var current_headline = 0;
 
 $(document).ready(function(){
   headline_count = $("div.headline").size();
   $("div.headline:eq("+current_headline+")").css('top','5px');
 
   headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
   $('#Infoslide1').hover(function() {
     clearInterval(headline_interval);
   }, function() {
     headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
     headline_rotate();
   });
 });
 
 function headline_rotate() {
   current_headline = (old_headline + 1) % headline_count; 
   $("div.headline:eq(" + old_headline + ")").animate({top: -205},"slow", function() {
     $(this).css('top','210px');
   });
   $("div.headline:eq(" + current_headline + ")").show().animate({top: 5},"slow");  
   old_headline = current_headline;
 }

// DIAPO PHOTO PAGE ARTICLE
$(document).ready(function() {
    $('#DiapoDoss').jcarousel({
	   wrap: 'circular'

    });
});
$(document).ready(function() {
    $('#DiapoDossBig').jcarousel({
    	wrap: 'first'
    });
});



