

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

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

                /*
					Instantiate a MenuBar:  The first argument passed to the constructor
					is the id for the Menu element to be created, the second is an 
					object literal of configuration properties.
                */

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

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

                var aSubmenuData = [
                
                    {
                        id: "lawnmowers", 
                        itemdata: [ 
                            {
                                text: "Wheeled Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/wheeled-lawn-mowers.htm", 
                                submenu: { 
                                            id: "fourwheeled", 
                                            itemdata: [
                                                { text: "Honda Wheeled Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/honda-wheeled-lawn-mowers.htm" },
                                                { text: "Hayter Wheeled Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/hayter-wheeled-lawn-mowers.htm" },
                                                { text: "John Deere Wheeled Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/john-deere-wheeled-lawn-mowers.htm" },
												{ text: "Mountfield Wheeled Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/mountfield-wheeled-lawn-mowers.htm" },
												{ text: "Warrior Wheeled Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/warrior-wheeled-lawn-mowers.htm" },
												{ text: "Lawnking Castel Wheeled Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/castel-wheeled-lawn-mowers.htm" },
												{ text: "Murray Wheeled Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/murray-wheeled-lawn-mowers.htm" },
												{ text: "SARP Wheeled Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/sarp-wheeled-lawn-mowers.htm" },
												{ text: "IBEA Wheeled Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/ibea-wheeled-lawn-mowers.htm" },
												{ text: "McCulloch Wheeled Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/mcculloch-wheeled-lawn-mowers.htm" },
												{ text: "Alpina Wheeled Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/alpina-wheeled-lawn-mowers.htm" },
												{ text: "Lawnflite Wheeled Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/lawnflite-wheeled-lawn-mowers.htm" },
												{ text: "Brill Wheeled Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/brill-wheeled-lawn-mowers.htm" },
												{ text: "Asuka Wheeled Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/asuka-wheeled-lawn-mowers.htm" },
												{ text: "Tuffcut Wheeled Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/tuffcut-wheeled-lawn-mowers.htm" },
												{ text: "Rover Wheeled Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/rover-wheeled-lawn-mowers.htm" },
												{ text: "Marina Wheeled Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/marina-wheeled-lawn-mowers.htm" },
												{ text: "Gardencare Wheeled Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/gardencare-wheeled-lawn-mowers.htm" },
												{ text: "Active Wheeled Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/active-wheeled-lawn-mowers.htm" },
												{ text: "Briggs and Stratton Wheeled Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/briggs-and-stratton-wheeled-lawn-mowers.htm" },
												{ text: "Mulching Four Wheel Mowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/mulching-lawn-mowers.htm" }
                                                
                                            ] 
                                        }
                            
                            }, 
                            { text: "Roller Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/roller-lawn-mowers.htm", 
                                submenu: { 
                                            id: "rearwheeled", 
                                            itemdata: [
                                                { text: "Honda Roller Lawnmowers", url:  "http://www.justlawnmowers.co.uk/lawnmowers/honda-roller-lawn-mowers.htm" },
                                                { text: "Hayter Roller Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/hayter-roller-lawn-mowers.htm" },
                                                { text: "John Deere Roller Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/john-deere-roller-lawn-mowers.htm" },
												{ text: "Mountfield Roller Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/mountfield-roller-lawn-mowers.htm" },
												{ text: "SARP Roller Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/sarp-roller-lawn-mowers.htm" },
												{ text: "IBEA Roller Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/ibea-roller-lawn-mowers.htm" },
												{ text: "Lawnflite Roller Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/lawnflite-roller-lawn-mowers.htm" },
												{ text: "Asuka Roller Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/asuka-roller-lawn-mowers.htm" },
												{ text: "Tuffcut Roller Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/tuffcut-roller-lawn-mowers.htm" },
												{ text: "Shanks Roller Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/shanks-roller-lawn-mowers.htm" },
												{ text: "Castel Roller Lawnmowers",  url: "http://www.justlawnmowers.co.uk/lawnmowers/lawn-king-castel-roller-lawn-mowers.htm" }
                                                
                                            ] 
                                        }
                            
                            },
                            { text: "Petrol Cylinder Mowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/petrol-cylinder-lawn-mowers.htm", 
                                submenu: { 
                                            id: "petrolcyclinder", 
                                            itemdata: [
                                                { text: "ATCO Petrol Cylinder", url: "http://www.justlawnmowers.co.uk/lawnmowers/atco-petrol-cylinder-lawn-mowers.htm" },
                                                { text: "Suffolk Punch Petrol Cylinder", url: "http://www.justlawnmowers.co.uk/lawnmowers/suffolk-punch-petrol-cylinder-lawn-mowers.htm" },
{ text: "Mountfield Emperor Petrol Cylinder", url: "http://www.justlawnmowers.co.uk/lawnmowers/mountfield-petrol-cylinder-lawn-mowers.htm" },
                                                { text: "Atco/Suffolk Punch Replacement Cassettes",  url: "http://www.justlawnmowers.co.uk/lawnmowers/Scarifier_Casettes.htm" }
                                                
                                            ] 
                                        }
                            
                            },
							{ text: "Electric Cylinder Mowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/electric-cylinder-lawn-mowers.htm" },
							{ text: "Petrol Hover Mowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/petrol-hover-mowers.htm" },
							{ text: "Electric Hover Mowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/electric-hover-mowers.htm" },
                            { text: "Electric Wheeled Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/electric-wheeled-lawn-mowers.htm" },
							{ text: "Electric Roller Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/electric-roller-lawn-mowers.htm" },
							{ text: "Electric Cordless Lawnmowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/cordless-rotary-lawn-mowers.htm" },
                            { text: "Hand Push Cylinder Mowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/hand-push-cylinder-lawn-mowers.htm" },
							{ text: "Mulching Mowers", url: "http://www.justlawnmowers.co.uk/lawnmowers/mulching-lawn-mowers.htm" },
							{ text: "Rough Cut/All Terrain Mowers", url: "http://www.justlawnmowers.co.uk/rough-cut-all-terrain.htm" },
                           
                        ]
                    },

                     {
                        id: "rideons", 
                        itemdata: [
                            { text: "Honda Rideons and Garden Tractors", url: "http://www.justlawnmowers.co.uk/ride-on-mowers-garden-tractors/honda-garden-tractors-ride-on-mowers.htm" },
							{ text: "Husqvarna Rideons and Garden Tractors", url: "http://www.justlawnmowers.co.uk/ride-on-mowers-garden-tractors/husqvarna-garden-tractors-ride-on-mowers.htm" },
                            { text: "John Deere Rideons and Garden Tractors", url: "http://www.justlawnmowers.co.uk/ride-on-mowers-garden-tractors/john-deere-garden-tractors-ride-on-mowers.htm" },
                            { text: "Mountfield Rideons and Garden Tractors", url: "http://www.justlawnmowers.co.uk/ride-on-mowers-garden-tractors/mountfield-garden-tractors-ride-on-mowers.htm" },
							{ text: "Alpina Rideons and Garden Tractors", url: "http://www.justlawnmowers.co.uk/ride-on-mowers-garden-tractors/alpina-garden-tractors-ride-on-mowers.htm" },
							{ text: "Murray Rideons and Garden Tractors", url: "http://www.justlawnmowers.co.uk/ride-on-mowers-garden-tractors/murray-garden-tractors-ride-on-mowers.htm" },
							{ text: "Hayter Rideons and Garden Tractors", url: "http://www.justlawnmowers.co.uk/ride-on-mowers-garden-tractors/hayter-garden-tractors-ride-on-mowers.htm" },
							{ text: "Front Deck Rideons", url: "http://www.justlawnmowers.co.uk/ride-on-mowers-garden-tractors/front-deck-garden-tractors-ride-on-mowers.htm" },   
							{ text: "Tractor Accessories including trailers", url: "http://www.justlawnmowers.co.uk/ride-on-mower-accessories.htm" }, 
                        ]    
                    },
                    
                    {
                        id: "brushcutters", 
                        itemdata: [
                             { text: "Petrol Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/petrol-grass-strimmers-brushcutters.htm", 
                                submenu: { 
                                            id: "petrol-brushcutters", 
                                            itemdata: [
                                                { text: "Honda 4 Stroke Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/honda-grass-strimmers-brushcutters.htm" },
                                                { text: "Tanaka Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/tanaka-grass-strimmers-brushcutters.htm" },
												{ text: "Husqvarna Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/husqvarna-grass-strimmers-brushcutters.htm" },
												{ text: "Lawnflite Heavy Duty Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/kawasaki-lawnflite-grass-strimmers-brushcutters.htm" },
												{ text: "Mountfield Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/mountfield-grass-strimmers-brushcutters.htm" },
												{ text: "Stihl Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/stihl-petrol-grass-strimmers-brushcutters.htm" },
												{ text: "Ryobi Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/ryobi-grass-strimmers-brushcutters.htm" },
												{ text: "Hayter Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/hayter-grass-strimmers-brushcutters.htm" },
                                                { text: "Gardencare Strimmers and Brushcutters",  url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/gardencare-petrol-grass-strimmers-brush-cutters.htm" }
                                                
                                            ] 
                                        }
                            
                            },
							
                            { text: "Electric Grass Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/electric-strimmers-brushcutters.htm" },
                            { text: "Combination Grass Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/brushcutters-strimmers-combi-units.htm" },
                            { text: "Wheeled Grass Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/strimmers-brushcutters/wheeled-strimmers-brushcutters.htm" },
                            { text: "Rough Terrain Grass Strimmers and Brushcutters", url: "http://www.justlawnmowers.co.uk/lawnmowers/rough-cut-all-terrain.htm" },
                           
                        ] 
                    },
					{
                        id: "chainsaws", 
                        itemdata: [
                            { text: "Petrol Chainsaws", url: "http://www.justlawnmowers.co.uk/chainsaws/petrol-chainsaws.htm" },
                            { text: "Electric Chainsaws", url: "http://www.justlawnmowers.co.uk/chainsaws/electric-chainsaws.htm" },
                           
                        ] 
                    },
                    
                    {
                        id: "hedgecutters",
                        itemdata: [
                            { text: "Petrol Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/petrol-hedge-cutters.htm",
							submenu: { 
                                            id: "petrol-hedgecutters", 
                                            itemdata: [
                                                { text: "Honda 4 Stroke Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/honda-hedge-cutters.htm" },
                                                { text: "Tanaka Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/tanaka-hedge-cutters.htm" },
												{ text: "Stihl Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/stihl-petrol-hedge-cutters.htm" },
												{ text: "Husqvarna Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/husqvarna-hedge-cutters.htm" },
												{ text: "Ryobi Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/ryobi-petrol-hedge-cutters.htm" },
												{ text: "Gardencare Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/gardencare-hedge-cutters-trimmers.htm" },
												{ text: "SARP Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/sarp-hedge-cutters.htm" },
												{ text: "Lawnflite Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/kawasaki-hedge-cutters.htm" },
                                                { text: "Mountfield Hedgecutters",  url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/mountfield-hedge-cutters.htm" }
                                                
                                            ] 
                                        }
							
							
							},
                            { text: "Electric Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/electric-hedge-cutters.htm",
							
							submenu: { 
                                            id: "electric-hedgecutters", 
                                            itemdata: [
                                                { text: "Bosch Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/bosch-electric-hedge-cutters.htm" },
                                                { text: "Stihl Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/stihl-electric-hedge-cutters.htm" },
                                                { text: "Ryobi Hedgecutters",  url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/ryobi-electric-hedge-cutters.htm" }
                                                
                                            ] 
                                        }
							
							 },
                            { text: "Long Reach Hedgecutters", url: "http://www.justlawnmowers.co.uk/hedge-cutters-trimmers/long-reach-hedge-cutters.htm" },
                          
                        ]
                    },
					{
                        id: "cultivators", 
                        itemdata: [
                            { text: "Honda Tillers, Rotavators and Cultivators", url: "http://www.justlawnmowers.co.uk/rotavators-cultivators-tillers/honda-rotavators-cultivators-tillers.htm" },
							{ text: "Husqvarna Tillers, Rotavators and Cultivators", url: "http://www.justlawnmowers.co.uk/rotavators-cultivators-tillers/husqvarna-rotavators-cultivators-tillers.htm.htm" },
                            { text: "Dori Tillers, Rotavators and Cultivators", url: "http://www.justlawnmowers.co.uk/rotavators-cultivators-tillers/dori-rotavators-cultivators-tillers.htm.htm" },
							{ text: "Centurion Tillers, Rotavators and Cultivators", url: "http://www.justlawnmowers.co.uk/rotavators-cultivators-tillers/centurion-rotavators-cultivators-tillers.htm" },
							{ text: "Grillo Tillers, Rotavators and Cultivators", url: "http://www.justlawnmowers.co.uk/rotavators-cultivators-tillers/alko-rotavators-cultivators-tillers.htm.htm" },
							{ text: "Merry Tiller Tillers, Rotavators and Cultivators", url: "http://www.justlawnmowers.co.uk/rotavators-cultivators-tillers/merry-tiller-rotavators-cultivators-tillers.htm.htm" },
							{ text: "Mountfield Tillers, Rotavators and Cultivators", url: "http://www.justlawnmowers.co.uk/rotavators-cultivators-tillers/mountfield-rotavators-cultivators-tillers.htm.htm" },
							{ text: "MTD Tillers, Rotavators and Cultivators", url: "http://www.justlawnmowers.co.uk/rotavators-cultivators-tillers/mtd-lawnflite-rotavators-cultivators-tillers.htm" },
							{ text: "Gardencare Tillers, Rotavators and Cultivators", url: "http://www.justlawnmowers.co.uk/rotavators-cultivators-tillers/gardencare-rotavators-tillers-cultivators.htm" },
							{ text: "Rally Tillers, Rotavators and Cultivators", url: "http://www.justlawnmowers.co.uk/rotavators-cultivators-tillers/rally-rotavators-cultivators-tillers.htm" },
                           
                        ] 
                    },
					{
                        id: "blowers", 
                        itemdata: [
                            { text: "Petrol Hand Held Leaf Blowers", url: "http://www.justlawnmowers.co.uk/leaf-blowers-vacuums-sweepers/hand-held-petrol-leaf-blowers-vacuums.htm" },
                            { text: "Electric Hand Held Leaf Blowers", url: "http://www.justlawnmowers.co.uk/leaf-blowers-vacuums-sweepers/hand-held-electric-leaf-blowers-vacuums.htm" },
				{ text: "Back Pack Leaf Blowers", url: "http://www.justlawnmowers.co.uk/leaf-blowers-vacuums-sweepers/back-pack-leaf-blowers.htm" },
{ text: "Petrol Wheeled Leaf Vacuums", url: "http://www.justlawnmowers.co.uk/leaf-blowers-vacuums-sweepers/wheeled-leaf-vacuums.htm" },				
{ text: "Billy Goat Wheeled Leaf Vacuums", url: "http://www.justlawnmowers.co.uk/leaf-blowers-vacuums-sweepers/billy-goat-leaf-vacuums.htm" },
{ text: "Agri-Fab Towed Leaf Collecors", url: "http://www.justlawnmowers.co.uk/ride-on-mower-accessories/agri-fab-towed-leaf-collectors.htm" },
{ text: "Petrol Wheeled Leaf Blowers", url: "http://www.justlawnmowers.co.uk/leaf-blowers-vacuums-sweepers/wheeled-leaf-blowers.htm" },
{ text: "Truck/Debris Loaders", url: "http://www.justlawnmowers.co.uk/leaf-blowers-vacuums-sweepers/billygoat-truckloaderDLseries.htm" },
							
                           
                        ] 
                    },
					{
						id: "more", 
                        itemdata: [
							{ text: "Scarifiers / Lawn Aerators", url: "http://www.justlawnmowers.co.uk/scarifiers-lawn-aerators.htm" },
							{ text: "Shredders and Chippers", url: "http://www.justlawnmowers.co.uk/garden-shredders-chippers.htm" },
                            { text: "Pole Saws/Pole Pruners", url: "http://www.justlawnmowers.co.uk/pole-pruners-saws.htm" },
							{ text: "Log Splitters", url: "http://www.justlawnmowers.co.uk/log-splitters.htm" },
							{ text: "Turf Cutters", url: "http://www.justlawnmowers.co.uk/turf-cutters.htm" },
							{ text: "Pushed Leaf Collectors", url: "http://www.justlawnmowers.co.uk/push-leaf-litter-collectors-sweepers.htm" },
							{ text: "Pushed Garden Rollers", url: "http://www.justlawnmowers.co.uk/garden-rollers/mtd-roller196.htm" },
							{ text: "Chemical Sprayers", url: "http://www.justlawnmowers.co.uk/garden-sprayers.htm" },
							{ text: "Chemical Spreaders", url: "http://www.justlawnmowers.co.uk/garden-spreaders/chemical.htm" },
							{ text: "Salt Spreaders", url: "http://www.justlawnmowers.co.uk/garden-spreaders/salt.htm" },
							{ text: "Rock Salt", url: "http://www.justlawnmowers.co.uk/rock-salt.htm" },
							{ text: "Snow Blowers/Throwers", url: "http://www.justlawnmowers.co.uk/snow-throwers-blowers.htm" },
							{ text: "Generators", url: "http://www.justlawnmowers.co.uk/generators.htm" },
							{ text: "Pressure Washers", url: "http://www.justlawnmowers.co.uk/pressure-washers.htm" },
							{ text: "Powered Barrows", url: "http://www.justlawnmowers.co.uk/powered-barrows/product924.htm" },
							{ text: "Gardening Tools", url: "http://www.justlawnmowers.co.uk/garden-tools.htm" },
							{ text: "Ryobi Cordless Power Tools", url: "http://www.justlawnmowers.co.uk/power-tools.htm" },
							{ text: "Cement Mixers", url: "http://www.justlawnmowers.co.uk/cement-mixers.htm" },
							
                        ] 
                    }
                ];


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


                /*
                     "beforeshow" event handler for each submenu of the MenuBar
                     instance, used to setup certain style properties before
                     the menu is animated.
                */

                function onSubmenuBeforeShow(p_sType, p_sArgs) {

                    var oBody,
                        oElement,
                        oShadow,
                        oUL;
                

                    if (this.parent) {

                        oElement = this.element;

                        /*
                             Get a reference to the Menu's shadow element and 
                             set its "height" property to "0px" to syncronize 
                             it with the height of the Menu instance.
                        */

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

                        
                        /*
                            Stop the Animation instance if it is currently 
                            animating a Menu.
                        */ 
                    
                        if (oAnim && oAnim.isAnimated()) {
                        
                            oAnim.stop();
                            oAnim = null;
                        
                        }


                        /*
                            Set the body element's "overflow" property to 
                            "hidden" to clip the display of its negatively 
                            positioned <ul> element.
                        */ 

                        oBody = this.body;


                        //  Check if the menu is a submenu of a submenu.

                        if (this.parent && 
                            !(this.parent instanceof YAHOO.widget.MenuBarItem)) {
                        

                            /*
                                There is a bug in gecko-based browsers and Opera where 
                                an element whose "position" property is set to 
                                "absolute" and "overflow" property is set to 
                                "hidden" will not render at the correct width when
                                its offsetParent's "position" property is also 
                                set to "absolute."  It is possible to work around 
                                this bug by specifying a value for the width 
                                property in addition to overflow.
                            */

                            if (ua.gecko || ua.opera) {
                            
                                oBody.style.width = oBody.clientWidth + "px";
                            
                            }
                            
                            
                            /*
                                Set a width on the submenu to prevent its 
                                width from growing when the animation 
                                is complete.
                            */
                            
                            if (ua.ie == 7) {

                                oElement.style.width = oElement.clientWidth + "px";

                            }
                        
                        }

    
                        oBody.style.overflow = "hidden";


                        /*
                            Set the <ul> element's "marginTop" property 
                            to a negative value so that the Menu's height
                            collapses.
                        */ 

                        oUL = oBody.getElementsByTagName("ul")[0];

                        oUL.style.marginTop = ("-" + oUL.offsetHeight + "px");
                    
                    }

                }


                /*
                    "tween" event handler for the Anim instance, used to 
                    syncronize the size and position of the Menu instance's 
                    shadow and iframe shim (if it exists) with its 
                    changing height.
                */

                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";
                    
                    }
                
                }


                /*
                    "complete" event handler for the Anim instance, used to 
                    remove style properties that were animated so that the 
                    Menu instance can be displayed at its final height.
                */

                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 = "";

                        }
                    
                    }
                    
                }


                /*
                     "show" event handler for each submenu of the MenuBar 
                     instance - used to kick off the animation of the 
                     <ul> element.
                */

                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];
                    

                        /*
                             Animate the <ul> element's "marginTop" style 
                             property to a value of 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();

    
                        /*
                            Subscribe to the Anim instance's "tween" event for 
                            IE to syncronize the size and position of a 
                            submenu's shadow and iframe shim (if it exists)  
                            with its changing height.
                        */
    
                        if (YAHOO.env.ua.ie) {
                            
                            oShadow.style.height = oElement.offsetHeight + "px";


                            /*
                                Subscribe to the Anim instance's "tween"
                                event, passing a reference Menu's shadow 
                                element and making the scope of the event 
                                listener the Menu instance.
                            */

                            oAnim.onTween.subscribe(onTween, oShadow, this);
    
                        }
    

                        /*
                            Subscribe to the Anim instance's "complete" event,
                            passing a reference Menu's shadow element and making 
                            the scope of the event listener the Menu instance.
                        */
    
                        oAnim.onComplete.subscribe(onAnimationComplete, oShadow, this);
                    
                    }
                
                }


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

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

					var nSubmenus = aSubmenuData.length,
						i;


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

						for (i = 0; i < nSubmenus; i++) {
                        	this.getItem(i).cfg.setProperty("submenu", aSubmenuData[i]);
						}

                    }

                });


                /*
                     Subscribe to the "beforeShow" and "show" events for 
                     each submenu of the MenuBar instance.
                */
                
                oMenuBar.subscribe("beforeShow", onSubmenuBeforeShow);
                oMenuBar.subscribe("show", onSubmenuShow);


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

                oMenuBar.render();         
            
            });


