var currentMenuId = 0;
var currentMenu = null;
var onMenu = false;

function afficheMenu(sourceEvent,menuId) {
	onMenu = true;
	sourceEvent.blur();
	if (menuId == currentMenuId) {
		hideCurrentMenu();
		return false;
	}
	if (currentMenuId != 0) hideCurrentMenu();
	var element = document.getElementById("MENU" + menuId);
	currentMenuId = menuId;
	currentMenu = element;
	element.style.display="block";
	return false;
}

function hideCurrentMenu() {
	if (currentMenuId != 0) {
		currentMenu.style.display = "none";
		currentMenu = null;
		currentMenuId = 0;
	}
}

function testMenu() {
	if (!onMenu) {
		hideCurrentMenu();
	}
	else {
		onMenu = false;
	}
}

function testAncre() {
	var ancre = location.hash;
	if ((ancre != null) && (ancre.length > 0)) {
	
		if (ancre.indexOf("#m_") == 0) {
			idths = ancre.substring(3);
			affiche(idths);
		}
	}

}

