/* 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: "Überblick", url: "../index.html" },
				{ text: "Image Size Reducer", url: "../imagesizereducer/index_de.html" }
			]
		},
		
		{
			id: "download", 
			itemdata: [
				{ text: "Image Size Reducer", url: "../imagesizereducer/download.html" }
			] 
		},
		
		{
			id: "buy", 
			itemdata: [
				{ text: "Image Size Reducer", url: "../imagesizereducer/buy_de.html" }
			] 
		},
		
		{
			id: "support", 
			itemdata: [
				{ text: "Fehler melden", url: "../contact.php" },
				{ text: "Kontakt", url: "../contact.php" }              
			]    
		},
		
		{
			id: "company", 
			itemdata: [
				{ text: "Über", url: "../company.html" },
				{ text: "Kontakt", url: "../contact.php" },     
				{ text: "Impressum", url: "../imprint.html" },      
				{ text: "AGB", 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();
});
