$(function affichesite(){
	
	var windowwidth = $(window).width();
	var windowheight = $(window).height();
	
	var heightvisuel = windowheight-322;
	
	var menuwidth = $('#menu').width()+10;
	
	$(document).ready(function() {
		$('#top, #bottom').css("height", windowheight/2+"px");
		$('#menu').css("left", "-"+menuwidth+"px");
		
		$('#visuel').css({
			'top' : '161px',
			'height' : heightvisuel+'px'
			});
		$('#top, #bottom').delay(1500).animate({
			height: '161px'
		}, 2000 );
		
		$('#menu').delay(3500).animate({
			left: '20px'
		}, 1000 );
		
		$('#maintenance').delay(3500).fadeIn('slow');
		
		$('#facebook').delay(4000).animate({
			bottom: '20px'
		}, 1000 );
		
		$('#copyright').delay(4500).animate({
			bottom: '20px'
		}, 1000 );
	});
});

$(function menu(){
	
	$('#menu a').click(function(){
		
		$clicked = $(this);
		
		var classclicked = String(this.className).split(' ')[1];
		
		var idToLoad = $clicked.attr('id').split('-')[0];
		
		if (classclicked != 'active') {
			
			$('a.btn').removeClass('active');
			$('.content-box').fadeOut();
			
			$clicked.addClass('active');
			
			$('#'+idToLoad+'-box').delay('slow').fadeIn();
		}
		else {
			
			$clicked.removeClass('active');
			
			$('#'+idToLoad+'-box').fadeOut();
		}
	});
});

function resizesite(){
	
	var windowheight = $(window).height();
	var heightvisuel = windowheight-322;
	
	$('#visuel').css("height", heightvisuel+"px");
};
