$(document).ready(function() {
	
	
	$('#works').ascensor({
	   AscensorName:'works_',
	           //you can choose the name that will define id and class (default:'maison')
	    WindowsFocus:true,
	 	WindowsOn:0,
	 	
	 	NavigationDirection:'xy',
	 	Direction: 'y',
	 	Navig:false,
	 	Link:false,
	 	ReturnURL:false,
	 	PrevNext:true,
	 	CSSstyles:true,
	 	
	 	KeyArrow:false,
	 	keySwitch:false,
	 	ReturnCode:false,
	 	
	 	ChocolateAscensor:true,
	 	AscensorMap: '4|4',
	 	ContentCoord: '1|1 & 1|2 & 2|1 & 3|1 & 3|2 & 4|1 & 4|2 & 5|1 & 5|2 & 6|1 & 7|1 & 7|2 & 7|3 & 7|4 & 8|1 & 9|1 & 9|2 & 9|3 & 10|1 & 11|1 & 11|2 & 12|1 & 12|2 & 13|1 & 13|2 & 13|3 & 14|1 & 14|2 & 15|1'
	   
	   
	});
	
	$('#general').hide()
	$('#general').animate({opacity: "0"},0);
	
	$('#menuSimple').hover(function(){
		$('#MenuNavigation').show();
	}, function(){
		$('#MenuNavigation').hide();
	});
	
	$('#MenuNavigation').hover(function(){
		$('#MenuNavigation').show();
	}, function(){
		$('#MenuNavigation').hide();
	});
	
	$('#MenuNavigation dt').click(function(){
			$('#MenuNavigation').hide();
	})
	
	$('#MenuNavigation dt a	').click(function(){
			$('#MenuNavigation').hide();
	});
	
	
	$('#infoSimple').hover(function(){
		$(this).css('color', '#c2c2c2');
		$('#infoDetail').show();
	}, function(){
		$(this).css('color', '#000');
		$('#infoDetail').hide();
	}).click(function(){
			$('#infoSimple').css('color', '#000');
			$('#infoDetail').hide();
	});
	
	
	$('#infoDetail').hover(function(){
		$('#infoDetail').show();
		$('#infoSimple').css('color', '#c2c2c2');
	}, function(){
		$('#infoSimple').css('color', '#000');
		$('#infoDetail').hide();
	}).click(function(){
			$('#infoSimple').css('color', '#000');
			$('#infoDetail').hide();
	});
	
	$('#MenuNavigation dt').hover(function(){
		$(this).find('.fleche').show();

	}, function(){
		$(this).find('.fleche').hide();
	});
	
	$('.SecondNavigation a').click(function(){
		$("#about").animate({opacity: "0"},500, function() {
		    $('#about').hide();
		  });	
	});
	
	$('#MenuNavigation dt:eq(1)').click(function(){
		$("#about").animate({opacity: "0"},500, function() {
		    $('#about').hide();
		  });	
	});
	
	$('#works_Prev').hover(function(){
			$(this).html('<img src="img/prev_hover.png"/>')
	
		}, function(){
			$(this).html('<img src="img/prev.png"/>')
		});
		
	$('#works_Next').hover(function(){
			$(this).html('<img src="img/next_hover.png"/>')
	
		}, function(){
			$(this).html('<img src="img/next.png"/>')
		});
	
	$('#works_Up').hover(function(){
			$(this).html('<img src="img/up_hover.png"/>')
	
		}, function(){
			$(this).html('<img src="img/up.png"/>')
		});
		
	$('#works_Down').hover(function(){
			$(this).html('<img src="img/down_hover.png"/>')
	
		}, function(){
			$(this).html('<img src="img/down.png"/>')
		});
		
		
		
	$('#aboutClose').hover(function(){
			$(this).html('<img src="img/close_hover.png"/>')
		
		}, function(){
			$(this).html('<img src="img/close.png"/>')
	});
		

	$('works_Prev:eq(1)').hide();
	$('works_Next:eq(1)').hide();

	$('.about').click(function(){
		$('#about').show();
		$("#about").animate({opacity: "1"},500);
		
		return false
	});
	
	$('#aboutClose').click(function(){
		$("#about").animate({opacity: "0"},500, function() {
		    $('#about').hide();
		  });	
		return false
	});
	
	
	windowsHeight = $(window).height();
	
	
		$('#about').hide();
		$("#about").animate({opacity: "0"},500);
		
	$(window).resize(function() {
		windowsHeight = $(window).height();
		$('.imgCenter').each(function(index){
			imgHeight = $(this).height();
			$(this).css({'padding-top':windowsHeight/2-imgHeight/2});
		});
	});
	
	$(window).load(function(){
		$('.imgCenter').each(function(index){
			imgHeight = $(this).height();
			$(this).css({'padding-top':windowsHeight/2-imgHeight/2});
		});
		
		$('#general').show()
		$('#map').show()
		$('#general').animate({opacity: "1"},1000);
		
		$('#loader').animate({opacity: "0"},1000, function() {
		    $('#loader').hide();
		  });
		
	});
	
	$('.outLink').attr("target","_blank");
	
});


