$(document).ready( function()
{
	// -----------------------------------------------------------------------------------------
	// Effets sur les formulaires du site Internet
	// -----------------------------------------------------------------------------------------
	
	var backgroundColor_init = "#ffffff"; // Couleur de fond initiale des formulaires
	var borderColor_init = "#cccccc"; // Couleur de bordure initiale des formulaires
	
	var backgroundColor_modif = "#efefef"; // Couleur de fond modifiée des formulaires
	var borderColor_modif = "#999999"; // Couleur de bordure modifiée des formulaires
		
	/*
	$("input, textarea").focus(function(){
		$(this).animate({ 
			backgroundColor: backgroundColor_modif,
			borderLeftColor: borderColor_modif,
			borderRightColor: borderColor_modif,
			borderTopColor: borderColor_modif,
			borderBottomColor: borderColor_modif
		  }, 250 );
	});
	 
	$("input, textarea").blur(function(){
		$(this).animate({ 
			backgroundColor: backgroundColor_init,
			borderLeftColor: borderColor_init,
			borderRightColor: borderColor_init,
			borderTopColor: borderColor_init,
			borderBottomColor: borderColor_init
		  }, 250 );
	});*/
	
	$("#formulaire_cv input, #formulaire_cv textarea").focus(function(){
		$(this).animate({ 
			backgroundColor: '#e4e8c4',
			borderLeftColor: '#e4e8c4',
			borderRightColor: '#e4e8c4',
			borderTopColor: '#e4e8c4',
			borderBottomColor: '#e4e8c4'
		  }, 250 );
	});
	 
	$("#formulaire_cv input, #formulaire_cv textarea").blur(function(){
		$(this).animate({ 
			backgroundColor: '#eef0dd',
			borderLeftColor: '#eef0dd',
			borderRightColor: '#eef0dd',
			borderTopColor: '#eef0dd',
			borderBottomColor: '#eef0dd'
		  }, 250 );
	});
	
	$(".submit").mouseover(function(){
		$(this).animate({ 
			backgroundColor: backgroundColor_modif,
			borderLeftColor: borderColor_modif,
			borderRightColor: borderColor_modif,
			borderTopColor: borderColor_modif,
			borderBottomColor: borderColor_modif
		  }, 250 );
	});
	 
	$(".submit").mouseout(function(){
		$(this).animate({ 
			backgroundColor: backgroundColor_init,
			borderLeftColor: borderColor_init,
			borderRightColor: borderColor_init,
			borderTopColor: borderColor_init,
			borderBottomColor: borderColor_init
		  }, 250 );
	});
	
	$("#img_banniere").cycle({		
		fx:     'fade', 
		speed:   1000, 
		timeout: 2300, 
		next:   '#img_banniere'
	});
	
	$("#img_banniere_2").cycle({
		fx:     'fade', 
		speed:   1000, 
		timeout: 2900, 
		next:   '#img_banniere_2'
	});
	
	// -----------------------------------------------------------------------------------------
	// Scroll
	// -----------------------------------------------------------------------------------------
	
	// Permet de remonter en haut de la page :
	$("#haut_de_page a").click(function(){
		jQuery("html, body").animate({ scrollTop: 0 }, "slow");
		return false;
	});
	
	// -----------------------------------------------------------------------------------------
	// Effets sur les images des galeries de photos :
	// -----------------------------------------------------------------------------------------

	$(".photos_galerie img").mouseover(function(){
	   $(this).animate({
		opacity: 0.8
	  }, 200 );
	});

	$(".photos_galerie img").mouseout(function(){
	   $(this).animate({
		opacity: 1
	  }, 200 );
	});
	
	// -----------------------------------------------------------------------------------------
	// Effets sur la taille du texte
	// -----------------------------------------------------------------------------------------
	
	$("#haut").mouseenter(function(){
		$("#zoom_p").slideDown(100);
		$("#zoom_m").slideDown(200);
		$("#facebook_ban").slideDown(300);
		$("#rss_ban").slideDown(400);
	});
	 
	$("#haut").mouseleave(function(){		
		$("#zoom_p").slideUp(400);
		$("#zoom_m").slideUp(300);
		$("#facebook_ban").slideUp(200);
		$("#rss_ban").slideUp(100);
	});
	
	$("#facebook_ban, #rss_ban").mouseover(function(){
	   $(this).animate({
		opacity: 0.8
	  }, 200 );
	});

	$("#facebook_ban, #rss_ban").mouseout(function(){
	   $(this).animate({
		opacity: 1
	  }, 200 );
	});
	
	// -----------------------------------------------------------------------------------------
	// Corners
	// -----------------------------------------------------------------------------------------
	
	$(".tableau_de_bord, .pb_droit, .confirme, .erreur, .informations, .chargement, .ajoute, .mots_cles, .pager").corner("8px");

	// -----------------------------------------------------------------------------------------
	// LightBox
	// -----------------------------------------------------------------------------------------

	$("a.affichetoi").lightBox();
	$("a.affichephoto").lightBox();
	$("a.ouvretoi").fancybox();
	
	// -----------------------------------------------------------------------------------------
	// Autres fonctions
	// -----------------------------------------------------------------------------------------
	
	initialisation_de_la_taille_de_police();
	
	$("a.afficheCV").fancybox({
		'frameWidth'        : 600,
		'frameHeight'		: 600,
		overlayOpacity		: 0.6,
		padding				: 20,
		overlayColor		: '#ae2164',
		centerOnScroll      : false
	});
	
	$(".conteneur_actualite").mouseenter(function(){
		var id_child=$(this).attr("id");
		$("#"+id_child+" .facebook").fadeIn("slow");
	});
	
	$(".conteneur_actualite").mouseleave(function(){	
		var id_child=$(this).attr("id");
		$("#"+id_child+" .facebook").fadeOut("slow");
	});
});
