$(document).ready(function(){
	var v_imgPath='images/header/';
	var ay_menu = new Array('index','expertises','references','realisations','agence');
		/*ay_menu['index']='agence';*/
	
	// détermination page courrante
	var v_currentPage = window.location.pathname, v_prevPage='null',v_nextPage='null';
	if (v_currentPage == '/') v_currentPage = 'index'; // site attaqué sur l'url brute
	for (x in ay_menu) {
		if (v_currentPage.search(ay_menu[x]) >=0) {
			v_prevPage = ay_menu[ parseInt(x)-1];
			v_currentPage = ay_menu[x];
			/*if (x < ay_menu.length) v_nextPage = ay_menu[parseInt(x)+1];*/
			break;
		}
	}
	// tous les bt au repos
	$('.menu_item').each(function(i){
		this.src = v_imgPath + ay_menu[i] + '.png';
	});
	// page courante
	$('#menu_'+v_currentPage).each(function(i){
		this.src = v_imgPath + v_currentPage + '-2.png';
	});
	//page précédente
	if (v_prevPage != 'null') {
		$('#menu_'+v_prevPage).each(function(i){
			this.src = v_imgPath + v_prevPage + '-3.png';
		});
	}
	//page suivante
	/*if (v_nextPage != 'null') {
		$('#menu_'+v_nextPage).each(function(i){
			this.src = v_imgPath + v_nextPage + '-3.png';
		});
	}*/
});
