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

	function onMenuBarBeforeRender(p_sType, p_sArgs) {

		var oSubmenuData = {
			"profilemenu": [

				{ text: "Our Approach & Ethos", url: "approach.html" },
				{ text: "Company History", url: "history.html" },
				{ text: "Safety & Environmental", url: "safety.html" },					
			],

			"servicesmenu": [

				{ text: "Interiors", url: "interiors.html" },
				{ text: "Fire Protection", url: "fireprotection.html" },
				{ text: "WRR (UK) Brochure PDF", url: "brochure.html" },
			],
			
			"projectsmenu": [

				{ text: "Retail", url: "folkstone.html" },
				{ text: "Leisure", url: "o2arena.html" },
				{ text: "Commercial", url: "britishdental.html" },
				{ text: "Education", url: "aylesbury.html" },
			],
			
			"awardsmenu": [

				{ text: "FIRAS", url: "firas.html" },
				{ text: "AIS", url: "ais.html" },
				{ text: "HBG Safety Award ", url: "hbgaward.html" },
			],
			
			"newsmenu": [

				{ text: "Three Awards in One Week", url: "news8.html" },
				{ text: "Acoustic Division Launch", url: "news7.html" },
				{ text: "WRR(UK) Launches Glazing Division", url: "news6.html" },
				{ text: "AIS Gold Award 2009", url: "news1.html" },
				{ text: "AIS Silver Award", url: "news2.html" },
				{ text: "Kemwell Thermal Ltd", url: "news3.html" },
				{ text: "Specialist Awards '08", url: "news4.html" },
				{ text: "Industry UK Article", url: "news5.html" },
				]
	   
		};

		this.getItem(1).cfg.setProperty("submenu", { id: "profilemenu", itemdata: oSubmenuData["profilemenu"] });
		this.getItem(2).cfg.setProperty("submenu", { id: "servicesmenu", itemdata: oSubmenuData["servicesmenu"] });
		this.getItem(4).cfg.setProperty("submenu", { id: "projectsmenu", itemdata: oSubmenuData["projectsmenu"] });
		this.getItem(5).cfg.setProperty("submenu", { id: "awardsmenu", itemdata: oSubmenuData["awardsmenu"] });
		this.getItem(6).cfg.setProperty("submenu", { id: "newsmenu", itemdata: oSubmenuData["newsmenu"] });

	}


	var oMenuBar = new YAHOO.widget.MenuBar("topcontent", { autosubmenudisplay: true, showdelay: 200, hidedelay:  750, lazyload: true });
	oMenuBar.beforeRenderEvent.subscribe(onMenuBarBeforeRender);
	oMenuBar.render();            

});