function initHome(){

$(document).ready( function () { 	

$("#news-nav").children().click(function() {
  displayCurrentNews($(this).attr('id'));
});	


$("#video-nav").children().click(function() {

  displayCurrentHomeVideo($(this).attr('id'));
});	


$("#video-nav").children().mouseenter(function() {
	 $(this).animate({opacity: '0.6'}, "medium");
  }).mouseleave(function() {
    $(this).animate({opacity: '1'}, "medium");
  });
  
  
  $(".news-left a").children().mouseenter(function() {
	 $(this).animate({opacity: '0.6'}, "medium");
  }).mouseleave(function() {
    $(this).animate({opacity: '1'}, "medium");
  });
  
  
  //init les blocks actifs

	 displayCurrentNews(1);
	 
	 var videoId = $("#video-nav a:nth-child(1)").attr('id');
	 
	displayCurrentHomeVideo(videoId);
} ) ; 

function displayCurrentNews(index){
	
	//affiche le block courant
	$("#news-container").children().hide();
	$('#news-container div.panel:nth-child('+index+')').fadeIn("slow");
	
	//attribue la classe courante dans le menu
	
	$("#news-nav").children().removeClass('active');
	$("#news-nav a:nth-child("+index+")").addClass('active');
}


function displayCurrentHomeVideo(videoId){
	
	//affiche le block courant
	
	//$('#video-container').empty();
	//$('#video-container').append('<iframe id="vimeo" src="http://player.vimeo.com/video/'+videoId+'?title=0&byline=0&portrait=0&color=f93c9a" width="425" height="239" frameborder="0"></iframe>');
	
	$('#vimeo').attr('src','http://player.vimeo.com/video/'+videoId+'?title=0&byline=0&portrait=0&color=f93c9a');
	
	
}


}

