function initHome(){

$(document).ready( function () { 	

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

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

$("#ref-nav").children().click(function() {
  displayCurrentRefs($(this).attr('id'));
});	
  
  
  //init les blocks actifs

	 displayCurrentNews(1);
	 displayCurrentOffres(1);
	 displayCurrentRefs(1);
	
} ) ; 

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 displayCurrentOffres(index){
	
	//affiche le block courant
	$("#offres-block").children().hide();
	$('#offres-block div.panel:nth-child('+index+')').fadeIn("slow");
	
	//attribue la classe courante dans le menu
	
	$("#offres-nav").children().removeClass('active');
	$("#offres-nav a:nth-child("+index+")").addClass('active');
}


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



}

