jQuery(document).ready(function(){
	
// download anim

	$('a#resume')
		.css({'background-position': "0 -276px"})
		.hover(
		function(){
   		$(this).stop().animate(
			{'background-position': "0 -136px"}, 120)},
		function(){
		$(this).stop().animate(
			{'background-position': "0 0"}, 190,
			function(){
				$(this).css({'background-position': "0 -276px"});
			})
		});
			
// contact anim

	$('a#contact')
		.css({'background-position': "-578px 0"})
		.hover(
		function(){
   		$(this).stop(true, false).animate(
			{'background-position': "-245px 0"}, 170)
		},
		function(){
		$(this).stop(true, false).animate(
			{'background-position':"88px 0"}, 250,
			function(){
				$(this).css({'background-position': "-578px 0"});
			})
		});
				
// resume tongues management

	$("a#fr").addClass('selected');
	
	$("a.tongue").click(function(){
		$("a.tongue").removeClass('selected');
		$(this).addClass('selected');
	});
	
	$("a#resume").click(function(){
		if ($("a.tongue#fr").hasClass('selected')){			
			window.open("resume/pierre-picouleau-fr.pdf");
		}else if ($("a.tongue#en").hasClass('selected')){
			window.open("resume/pierre-picouleau-en.pdf");
		}
		
	});

// displaying asides

	$("a#pierre").click(function(){
		$("aside#pierre").toggle();
	});
	
	$("a#siret").click(function(){
		$("aside#siret").toggle();
	});
	
	/*
	$(document).click(function(e) {
		if (!$(e.target).parents().andSelf().is('a#pierre, a#siret, a#more')) {
			$("aside").css('display','none');
		}
	});
	*/
	
// 'more' text

	$("a#more").click(function(){
		$("em").toggle();
	});
	
});







