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

function loadPageSiteWrap(p_sType, p_aArgs, obj)
{
	loadPageSite(obj);
}

var oMenuBar = new YAHOO.widget.MenuBar("zoneMenu", { 
											autosubmenudisplay: true, 
											hidedelay: 750, 
											lazyload: true/*,
											effect: { 
												effect: YAHOO.widget.ContainerEffect.FADE,
												duration: 0.25
											}*/
										});

var aSubmenuData = [

	/*{
		id: "accueil", 
		itemdata: [ 
			{ text: "Public", onclick: { fn: loadPageSiteWrap, obj:4 } }
		]
	},*/

	{
		id: "entreprise", 
		itemdata: [
			{ text: "Vision", onclick: { fn: loadPageSiteWrap, obj:7} },
			{ text: "Mission", onclick: { fn: loadPageSiteWrap, obj:8} },
			{ text: "Valeurs", onclick: { fn: loadPageSiteWrap, obj:9} }/*,
			{ text: "Savoir faire", onclick: { fn: loadPageSiteWrap, obj:6} }*/
		]    
	},
	
	/*{
		id: "carrieres", 
		itemdata: [
			{ text: "Types d'emplois", url: "http://www.jobboom.com", disabled: true },
			{ text: "Emplois", onclick: { fn: loadPageSiteWrap, obj:3 }}            
		] 
	},*/
	
	/*{
		id: "nousjoindre",
		itemdata: [
			{ text: "T&eacute;l&eacute;phone", url: "http://downloads.yahoo.com" },
			{ text: "Courriel", url: "http://finance.yahoo.com" },
			{ text: "Fax", url: "http://health.yahoo.com" },
			{ text: "Formulaire", url: "http://local.yahoo.com" }
		]
	}*/                   
];

/*var ua = YAHOO.env.ua,
	oAnim;  // Animation instance

function onSubmenuBeforeShow(p_sType, p_sArgs) {

	var oBody,
		oElement,
		oShadow,
		oUL;

	if (this.parent) {
		oElement = this.element;

		oShadow = oElement.lastChild;
		oShadow.style.height = "0px";

		if (oAnim && oAnim.isAnimated()) {
			oAnim.stop();
			oAnim = null;
		}

		oBody = this.body;

		//  Check if the menu is a submenu of a submenu.
		if (this.parent && 
			!(this.parent instanceof YAHOO.widget.MenuBarItem)) {

			if (ua.gecko || ua.opera) {			
				oBody.style.width = oBody.clientWidth + "px";			
			}

			if (ua.ie == 7) {
				oElement.style.width = oElement.clientWidth + "px";
			}	
		}

		oBody.style.overflow = "hidden";

		oUL = oBody.getElementsByTagName("ul")[0];
		oUL.style.marginTop = ("-" + oUL.offsetHeight + "px");
	}
}

function onTween(p_sType, p_aArgs, p_oShadow) {

	if (this.cfg.getProperty("iframe")) {
		this.syncIframe();
	}
	if (p_oShadow) {
		p_oShadow.style.height = this.element.offsetHeight + "px";
	}
}

function onAnimationComplete(p_sType, p_aArgs, p_oShadow) {

	var oBody = this.body,
		oUL = oBody.getElementsByTagName("ul")[0];

	if (p_oShadow) {
		p_oShadow.style.height = this.element.offsetHeight + "px";
	}

	oUL.style.marginTop = "";
	oBody.style.overflow = "";
	
	//  Check if the menu is a submenu of a submenu.
	if (this.parent && 
		!(this.parent instanceof YAHOO.widget.MenuBarItem)) {
		// Clear widths set by the "beforeshow" event handler
		if (ua.gecko || ua.opera) {	
			oBody.style.width = "";	
		}	
		if (ua.ie == 7) {
			this.element.style.width = "";
		}	
	}	
}

function onSubmenuShow(p_sType, p_sArgs) {

	var oElement,
		oShadow,
		oUL;

	if (this.parent) {
		oElement = this.element;
		oShadow = oElement.lastChild;
		oUL = this.body.getElementsByTagName("ul")[0];
	
		oAnim = new YAHOO.util.Anim(oUL, 
			{ marginTop: { to: 0 } },
			.5, YAHOO.util.Easing.easeOut);

		oAnim.onStart.subscribe(function () {
			oShadow.style.height = "100%";
		});
		oAnim.animate();
		
		if (YAHOO.env.ua.ie) {	
			oShadow.style.height = oElement.offsetHeight + "px";
			oAnim.onTween.subscribe(onTween, oShadow, this);
		}
		oAnim.onComplete.subscribe(onAnimationComplete, oShadow, this);
	}
}*/

oMenuBar.subscribe("beforeRender", function () {
	if (this.getRoot() == this) {
		//this.getItem(0).cfg.setProperty("submenu", aSubmenuData[0]);
		this.getItem(1).cfg.setProperty("submenu", aSubmenuData[0]);
		//this.getItem(2).cfg.setProperty("submenu", aSubmenuData[2]);
		//this.getItem(3).cfg.setProperty("submenu", aSubmenuData[3]);
	}
});

/*oMenuBar.subscribe("beforeShow", onSubmenuBeforeShow);
oMenuBar.subscribe("show", onSubmenuShow);*/

oMenuBar.render();

});
