$(function() {
	montrerMenu(0);
		
	/*$('div#menuG li a').mouseenter(function(){
		 $(this).animate({
			backgroundPosition: "-30px"
		},200);
	});*/



	$("#print_button").click(function(){
			$(".block_content").printArea({popX:0,popY:0});
	});

	
	$('div#menuG li a').bind("mouseenter",function(){
		 $(this).animate({
			backgroundPosition: "-30px"
		},200);
	});
	
	$('div#menuG li a').bind("mouseleave",function(){
		var distance =  $(this).attr('rel');
		 $(this).animate({
			backgroundPosition: distance+"px"
		},200);
	});	
	$('.lightbox').lightBox();
});

function showMenu(id, idLien){
	if($(id+':visible').length == 0){
		$(idLien).addClass('actif');
	}else{
		$(idLien).removeClass('actif');
	}
	$(id).slideToggle(350);
}




function ouvrirService(div){
	$('.divBlocService').hide();
	$(div).fadeIn('slow');
	return true;
}

function temporisationMenu(id){
	setTimeout(function(){
       montrerMenu(id+1);
     }, 50); 
}

function montrerMenu(id){
	if(id < 9){
		var distance = $('div#menuG li a:eq('+id+')').attr('rel');
		$('div#menuG li a:eq('+id+')').animate({
				backgroundPosition: "-30px"
			},200).animate({
				backgroundPosition: distance+"px"
				},200, temporisationMenu(id));
		
	}
}
