

$(function() {
	
	// fade in page accueil
	$('#wrapper-home #h h1').hide().fadeIn(2500);	
	$('#wrapper-home #h #medaillon-bruxelles').hide().fadeTo(1000, 1).fadeIn(2500);
	$('#wrapper-home #h #medaillon-iwsc').hide().fadeTo(2000, 1).fadeIn(2500);
	
	
		   
	// Premier H2, on lui dit margin-top = 0	
	$('#content h2:first').css('padding-top', '0');
	
	// Premier H3 de chaque layout, on lui dit margin-top = 0
	$('#content .layout .a h3:nth-child(1), #content .layout .b h3:nth-child(1), , #content .layout .c h3:nth-child(1), , #content .layout .d h3:nth-child(1)').css('margin-top', '0');	
		   
	// premier tr de la table, on lui dit border-left = 0
	$('#content table.tableau td:nth-child(1)').css('border-left', '0');
		   
	// table / effet pyjama
	$('#content table.tableau td:nth-child(1)').css('padding-left', '35px');
	$('#content table.tableau tbody tr:nth-child(odd)').addClass('odd');	
	
	
	// On rajoute une classe hover sur le td de la table pour le onmouse pour voir oł l'on se trouve sur la table
	$('#content table.tableau tr td').hover(function(){
		$(this).parent().addClass('td-hover');
	}, function (){
		$(this).parent().removeClass('td-hover');
	});
	
	$("table.galerie td a").attr("class", "nyroModal");

	// Apparition  de la Gamme de Champagne
		$("#gamme .champagne").not(":first").hide(); 
		$("#gamme-navigation ul li:first").addClass("actif"); 
		
		// on enleve d'abord la classe actif au cas ou, et on rajoute la classe 'actif'
		$("#gamme-navigation ul a").click(function(){ 				
			$("#gamme-navigation ul a").parent("li").removeClass("actif"); 
			$(this).parent("li").addClass("actif");
		}); 
		
		//$('#gamme').apppend("<div class='test'></div>");
		$('#gamme').css('height' , '450px');
		
		$("#gamme-navigation ul li a").click(function(){ 											   
			// apparition sur le bloc de droite			
			$("#gamme .champagne").hide(); 			
			$(this.hash).show("slow"); 				
			return false; 
		}); 
		
		// Image - Tooltip	
		$('a.nyroModal').hover(function(e) {
			var html = '<div id="more-info">';
			html +=    'Cliquer pour agrandir / Click here';
			html +=		'</div>';
		
		$('body').append(html).children('#info').hide().fadeIn(400);
		$('#more-info').css('top', e.pageY - 50).css('left', e.pageX + 20);
			
		}, function() {
			$('#more-info').remove();
		});
	
		$('a.nyroModal').mousemove(function(e) {
			$('#more-info').css('top', e.pageY - 50).css('left', e.pageX + 20);
		});

	 
});

