YAHOO.example.onMenuBarReady = function() {
                // Animation object
                var oAnim;
                // Utility function used to setup animation for submenus
                function setupMenuAnimation(p_oMenu) {
                    if(!p_oMenu.animationSetup) {
                        var aItems = p_oMenu.getItemGroups();
                            if(aItems && aItems[0]) {
                                var i = aItems[0].length - 1;
                            var oSubmenu;

                            do {

                                oSubmenu = p_oMenu.getItem(i).cfg.getProperty("submenu");
        
                                if(oSubmenu) {
        
                                    oSubmenu.beforeShowEvent.subscribe(onMenuBeforeShow, oSubmenu, true);
                                    oSubmenu.showEvent.subscribe(onMenuShow, oSubmenu, true);
        
                                }
                            
                            }
                            while(i--);
                        
                        }

                        p_oMenu.animationSetup = true;

                    }

                }


                // "beforeshow" event handler for each submenu of the menu bar

                function onMenuBeforeShow(p_sType, p_sArgs, p_oMenu) {

                    if(oAnim && oAnim.isAnimated()) {
                    
                        oAnim.stop();
                        oAnim = null;
                    
                    }

                    YAHOO.util.Dom.setStyle(this.element, "overflow", "hidden");
                    YAHOO.util.Dom.setStyle(this.body, "marginTop", ("-" + this.body.offsetHeight + "px"));

                }


                // "show" event handler for each submenu of the menu bar

                function onMenuShow(p_sType, p_sArgs, p_oMenu) {

                    oAnim = new YAHOO.util.Anim(
                        this.body, 
                        { marginTop: { to: 0 } },
                        .5, 
                        YAHOO.util.Easing.easeOut
                    );

                    oAnim.animate();

                    var me = this;
                        
                    function onTween() {

                        me.cfg.refireEvent("iframe");
                    
                    }

                    function onAnimationComplete() {

                        YAHOO.util.Dom.setStyle(me.body, "marginTop", ("0px"));
                        YAHOO.util.Dom.setStyle(me.element, "overflow", "visible");

                        setupMenuAnimation(me);

                    }
                    

                    /*
                         Refire the event handler for the "iframe" 
                         configuration property with each tween so that the  
                         size and position of the iframe shim remain in sync 
                         with the menu.
                    */

                    if(this.cfg.getProperty("iframe") == true) {

                        oAnim.onTween.subscribe(onTween);

                    }

                    oAnim.onComplete.subscribe(onAnimationComplete);
                
                }


                // "beforerender" event handler for the menu bar

                function onMenuBeforeRender(p_sType, p_sArgs, p_oMenu) {

                    var oSubmenuData = {
                    
                        "home": [                         

                        ],
    
                        "health": [
{ url: "/health/topics/index.shtml", text: "Mental Health Topics" },
{ url: "/health/publications/index.shtml", text: "Publications" },
{ url: "/health/trials/index.shtml", text: "Clinical Trials" },
{ url: "/health/outreach/index.shtml", text: "NIMH Outreach" },
{ url: "/health/topics/statistics/index.shtml", text: "Statistics" }
                        ],
                        
                        "research": [
{ url: "/research-funding/index.shtml", text: "Research Funding Homepage" },						
{ url: "/research-funding/grants/index.shtml", text: "Grants" },
{ url: "/research-funding/contracts/index.shtml", text: "Contracts" },
{ url: "/research-funding/training/index.shtml", text: "Training" },
{ url: "/research-funding/small-business/index.shtml", text: "Small Business" },
{ url: "/research-funding/scientific-meetings/index.shtml", text: "Scientific Meetings" }
                        ],
                        
                        "news": [
{ url: "/science-news/2009/index.shtml", text: "2009" },
{ url: "/science-news/2008/index.shtml", text: "2008" },
{ url: "/science-news/2007/index.shtml", text: "2007" },
{ url: "/science-news/2006/index.shtml", text: "2006" },
{ url: "/science-news/2005/index.shtml", text: "2005" },
{ url: "/science-news/2004/index.shtml", text: "2004" },
{ url: "/science-news/2003/index.shtml", text: "2003" },
{ url: "/science-news/2002/index.shtml", text: "2002" }
                        ],
						
						"about": [
{ url: "/about/director/index.shtml", text: "Director's Corner" },
{ url: "/about/strategic-planning-reports/index.shtml", text: "Strategic Plans" },
{ url: "/about/connect-with-nimh/index.shtml", text: "Connect with NIMH" },
{ url: "/about/organization/index.shtml", text: "Organization" },
{ url: "/about/advisory-boards-and-groups/index.shtml", text: "Advisory Boards & Groups" },
{ url: "/about/budget/index.shtml", text: "Budget" }
						]
                    
                    };


                    //this.getItem(0).cfg.setProperty("submenu", { id:"homeS", itemdata: oSubmenuData["home"] });
                    this.getItem(1).cfg.setProperty("submenu", { id:"healthS", itemdata: oSubmenuData["health"] });
                    this.getItem(2).cfg.setProperty("submenu", { id:"researchS", itemdata: oSubmenuData["research"] });
                    this.getItem(3).cfg.setProperty("submenu", { id:"newsS", itemdata: oSubmenuData["news"] });
					this.getItem(4).cfg.setProperty("submenu", { id:"aboutS", itemdata: oSubmenuData["about"] });

                    setupMenuAnimation(this);

                }


                // Initialize the root menu bar

                var oMenuBar = new YAHOO.widget.MenuBar("navWrap", { autosubmenudisplay:true, hidedelay:750, lazyload:true });

				

                // Subscribe to the "beforerender" event

                oMenuBar.beforeRenderEvent.subscribe(onMenuBeforeRender, 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("navWrap", YAHOO.example.onMenuBarReady);
