/* Ambiera e.U. Menu based on Yahoo JUI Library */

YAHOO.util.Event.onContentReady("ambieramenubar", function () 
{
	var oMenuBar = new YAHOO.widget.MenuBar("ambieramenubar", { 
												autosubmenudisplay: true, 
												hidedelay: 750, 
												showdelay: 50,
												lazyload: true });

	var aSubmenuData = [
	
		{
			id: "products", 
			itemdata: 
				[
					[ 
						{ text: "Overview", url: "../index.html" }						
					],
					[ 
						{ text: "Commercial Software:", url: "../index.html", disabled:true },
						{ text: "CopperCube 3D", url: "../coppercube/index.html" },
						{ text: "WebsitePainter", url: "../websitepainter/index.html" },
						{ text: "irrKlang", url: "../irrklang/index.html" },
						{ text: "irrFuscator", url: "../irrfuscator/index.html" },
						/*{
							text: "Free Software", 
							submenu: { 
										id: "pim", 
										itemdata: [
											{ text: "irrEdit", url: "../irredit/index.html" },
											{ text: "irrXML", url: "../irrxml/index.html" }
										] 
									}
						
						}*/
					],
					[ 
						{ text: "Free Software:", url: "../index.html", disabled:true },
						{ text: "CopperLicht", url: "../copperlicht/index.html" },
						{ text: "irrEdit", url: "../irredit/index.html" },
						{ text: "irrXML", url: "../irrxml/index.html" }
						
					]
				]
		},
		
		{
			id: "download", 
			itemdata: [
				{ text: "CopperCube 3D", url: "../coppercube/download.html" },
				{ text: "WebsitePainter", url: "../websitepainter/download.html" },
				{ text: "irrKlang", url: "../irrklang/downloads.html" },
				{ text: "irrFuscator", url: "../irrfuscator/downloads.html" },
				{ text: "CopperLicht", url: "../copperlicht/download.html" },
				{ text: "irrEdit", url: "../irredit/downloads.html" },
				{ text: "irrXML", url: "../irrxml/downloads.html" }
			] 
		},
		
		{
			id: "buy", 
			itemdata: [
				{ text: "CopperCube 3D", url: "../coppercube/buy.html" },
				{ text: "WebsitePainter", url: "../websitepainter/buy.html" },
				{ text: "irrKlang", url: "../irrklang/irrklang_pro.html" },
				{ text: "irrFuscator", url: "../irrfuscator/buy.html" },
				{ text: "irrEdit source code", url: "../irredit/source_and_more.html" },
				{ text: "CopperLicht source license", url: "../copperlicht/license.html#commercial" }
			] 
		},
		
		{
			id: "support", 
			itemdata: [
				{ text: "Forum", url: "../forum.php" },
				{ text: "Report a bug", url: "../contact.php" },
				{ text: "Contact", url: "../contact.php" }              
			]    
		},
		
		{
			id: "company", 
			itemdata: [
				{ text: "About", url: "../ambiera.html" },
				{ text: "Contact", url: "../contact.php" },
				{ text: "Newsletter", url: "../newsletter.php" },      
				{ text: "Twitter", url: "http://www.twitter.com/ambiera", target: "_blank" }, 
				{ text: "Affiliates and Reselling", url: "../affiliates.html" }, 				
				{ text: "Imprint", url: "../imprint.html" },
			    { text: "Terms and Conditions", url: "../terms_and_conditions.html" }				
			] 
		} 	
	];


	/*
		 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]);
			}

		}

	});

	oMenuBar.render();
});
