            /*
                 Initialize and render the MenuBar when its elements are ready 
                 to be scripted.
            */

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

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

                var oMenuBar = new YAHOO.widget.MenuBar("menuSeismicHazard", { 
                                                            autosubmenudisplay: true, 
                                                            hidedelay: 750, 
                                                            lazyload: true });

                /*
                     Define an array of object literals, each containing 
                     the data necessary to create a submenu.
                */

                var aSubmenuData = [
						{
                        id: "menu1", 
                        itemdata: [
                             {text: "", url: "#" },
                        ] 
                    },
                    
                    {
                        id: "menu2", 
                        itemdata: [
							{ text: "Spettri di risposta per la progettazione, NTC 2008 (G.U. 29, 04.02.2008)", url: "pannello.php?pg=smoothspectraprogetto_ntc" },
							{ text: "Spettri di risposta elastici, NTC 2008 (G.U. 29, 04.02.2008)", url: "pannello.php?pg=smoothspectra_ntc" }
                        ]    
                    } ,
                    {
                        id: "menu3", 
                        itemdata: [
                             {text: "Pericolosit&agrave; sismica, INGV-DPC 2004/2006", url: "pannello.php?pg=sh" },
                            { text: "Curve probabilistiche di hazard, INGV-DPC 2004/2006 (Progetto S1, Deliverable D2)", url: "pannello.php?pg=shc" },
                            { text: "Ordinate spettrali, INGV-DPC 2004/2006 (Progetto S1, Deliverable D3)", url: "pannello.php?pg=spectra" },
                        ] 
                    }
                ];


                /*
                     Subscribe to the "beforerender" event, adding a submenu 
                     to each of the items in the MenuBar instance.
                */

                oMenuBar.subscribe("beforeRender", function () {

                    if (this.getRoot() == this) {

                        this.getItem(0).cfg.setProperty("submenu", "");
                        this.getItem(1).cfg.setProperty("submenu", aSubmenuData[1]);
						this.getItem(2).cfg.setProperty("submenu", aSubmenuData[2]);

                    }

                });


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

                oMenuBar.render();         
            
            });

