// the llauren conspiracy "somewhere else" menu
// built on YUI (note dependencies)

// based on example code at http://developer.yahoo.com/yui/examples/menu/topnavfromjs.html



YAHOO.example.onMenuBarReady = function() {
// "beforerender" event handler for the menu bar
function onMenuBarBeforeRender(p_sType, p_sArgs, p_oMenu) {
        var oSubmenuData = {
        "communication": [
                { text: "my blog", url: "http://www.navelfluff.org" },
                { text: "my photos", url: "http://flickr.com/photos/llauren" },
                { text: "my playground", url: "http://www.llauren.net " },
                { text: "my family", url: "http://start.lauren.fi" },
                { text: "jobs", submenu: { id: "subjobs", itemdata: [
                        { text: "eCraft (current)",  url:"http://www.eCraft.com" },
                        { text: "tml (2006)",  url:"http://www.tml.tkk.fi" },
                        { text: "undp (2005)", url:"http://www.undp.org" },
                        { text: "kudos (00-05)", url:"http://www.kudos.com" }
                ] }
                },
                { text: "projects", submenu: { id: "subprojs", itemdata: [
                        { text: "freakopedia (b0rken)", url:"http://freakopedia.org" },
                        { text: "nados (dedd)", url:"http://nados.net" },
                        { text: "bandnames (gone)", url:"http://bandnames.tk" }
                ] }
                },
                { text: "networks", submenu: { id: "subnets", itemdata: [
                        { text: "last.fm", url:"http://last.fm/user/llauren" },
                        { text: "linked.in", url:"http://www.linkedin.com/in/llauren" },
                        { text: "faced.off", url:"http://www.facebook.com/profile.php?id=557052083" },
                        { text: "spaced.out", url:"http://www.myspace.com/thellauren" }
                ] }
                },
        ]
        };


        this.getItem(0).cfg.setProperty("submenu", { id:"communication", itemdata: oSubmenuData["communication"] });
}

// Instantiate and render the menu bar
var oMenuBar = new YAHOO.widget.MenuBar("productsandservices", { autosubmenudisplay:true, showdelay:250, hidedelay:750, lazyload:true }
);

// Subscribe to the "beforerender" event
oMenuBar.beforeRenderEvent.subscribe(onMenuBarBeforeRender, oMenuBar, true);

// Render the menu bar
oMenuBar.render();
};


// Initialize and render the menu bar when it is available in the DOM
YAHOO.util.Event.onContentReady("productsandservices", YAHOO.example.onMenuBarReady);
