function quitter(p_sType, p_aArgs, obj)
{
    alert("Salut...!");
}

YAHOO.util.Event.onDOMReady(function () {
    var aItemData = [

    {
        text: "<em id=\"sel\">SEL!</em>",
        submenu: {
            id: "sel",
            itemdata: [
                { text: "Quitter", onclick: { fn: quitter, obj:0} }
            ]
        }
    },

    {
        text: "Gestion",
        submenu: {
            id: "gestionmenu",
            itemdata: [
                { text: "Catégories", onclick:{fn:ChargerModuleIndex, obj:CTE_MODULE_CATEGORIES} },
                { text: "Événements" },
                { text: "Groupes" },
                { text: "Messages" },
                { text: "MRC" },
                { text: "Rôle", onclick:{fn:ChargerModuleIndex, obj:CTE_MODULE_ROLES} },
                { text: "Services" },
                { text: "Statuts" },
                { text: "Villes" }
            ]
        }

    },

    {
        text: "Inscriptions",
        submenu: {
            id: "inscriptions",
            itemdata: [
                { text: "Créer", onclick:{fn:ChargerFichier, obj:"ajoutinscription"} },
                { text: "<hr>" },
                { text: "Listes",
                    submenu: {
                        id: "listerinscriptions",
                        itemdata: [
                            { text: "Actives" },
                            { text: "En attente" },
                            { text: "En traitement" }
                        ]
                    }
                }
            ]
        }
    },

    "View",
    "Favorites",
    "Tools",
    "Help"
    ];

    var oMenuBar = new YAHOO.widget.MenuBar("menutop", {
                                            lazyload: true,
                                            itemdata: aItemData
                                            });

    oMenuBar.render("menu");

    function onSubmenuShow()
    {
    var oIFrame,oElement,nOffsetWidth;

    if (this.id == "sel")
    {
        YAHOO.util.Dom.setX(this.element, 0);

        oIFrame = this.iframe;

        if (oIFrame)
        {
            YAHOO.util.Dom.setX(oIFrame, 0);
        }
        this.cfg.setProperty("x", 0, true);
    }

    if ((this.id == "gestionmenu" || this.id == "inscriptions") && YAHOO.env.ua.ie)
    {
        oElement = this.element;
        nOffsetWidth = oElement.offsetWidth;

        oElement.style.width = nOffsetWidth + "px";
        oElement.style.width = (nOffsetWidth - (oElement.offsetWidth - nOffsetWidth)) + "px";
    }
    }

    oMenuBar.subscribe("show", onSubmenuShow);
})


