YAHOO.util.Event.onContentReady("basicmenu", function () {

	/*
		 Instantiate a Menu:  The first argument passed to the 
		 constructor is the id of the element in the page 
		 representing the Menu; the second is an object literal 
		 of configuration properties.
	*/

	var oMenu = new YAHOO.widget.Menu("basicmenu", { fixedcenter: false });


	/*
		 Call the "render" method with no arguments since the 
		 markup for this Menu instance is already exists in the page.
	*/

	oMenu.render();


	YAHOO.util.Event.addListener("menutoggle", "click", oMenu.show, null, oMenu);

});


var menuLocked = false;
var mouseEnterBMenu = false;
var button;
var styleOver = "#F5F7C9 url('./img/puce/selectbas-hover.png') no-repeat scroll left"; /* #32210A */

var styleOut = "#5F5846 url('./img/puce/selectbasa.png') no-repeat scroll left";

document.getElementById("basicmenu").style.left = "0";
document.getElementById("basicmenu").style.border = "1px solid white";
document.getElementById("basicmenu").style.backgroundColor = "white";

function menuEventClicked(id) {
			
	if (!menuLocked) {
		button.style.background = styleOver;
		button.style.color = "#32210A";
	
		menuLocked = true;
	}
	
}

function menuEventOver(id) {
	
	button = document.getElementById(id);
	
	button.style.background = styleOver;
	button.style.color = "#32210A";

}

function menuEventOut(id) {
				
	mouseEnterBMenu = false;
	
	if (!menuLocked ) {
		button.style.background = styleOut;
		button.style.color = "#F5F7C9";
	}
	
} 

function menuEventClear(id) {

	if (!menuLocked || !mouseEnterBMenu) {
		
		button.style.background = styleOut;
		button.style.color = "#F5F7C9";
		mouseEnterBMenu = true;
		menuLocked = false;
	}

} 

function menuEventOverBMenu(id) {
	
	mouseEnterBMenu = true;
	menuLocked = true;
	
	button.style.background = styleOver;
	button.style.color = "#32210A";

}

function menuEventOutBMenu(id) {
	
	mouseEnterBMenu = false;
		
}

function deLockedMenu() {
	
	if (!mouseEnterBMenu)
	menuLocked = false;

}
