/* 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: "Image Size Reducer", url: "../imagesizereducer/index.html" }
			]
		},
		
		{
			id: "download", 
			itemdata: [
				{ text: "Image Size Reducer", url: "http://www.ambiera.at/downloads/ImageSizeReducer-1.0.2-Setup.exe" }
			] 
		},
		
		{
			id: "buy", 
			itemdata: [
				{ text: "Image Size Reducer", url: "../imagesizereducer/buy.html" }
			] 
		},
		
		{
			id: "support", 
			itemdata: [
				{ text: "Report a bug", url: "../contact.php" },
				{ text: "Contact", url: "../contact.php" }              
			]    
		},
		
		{
			id: "company", 
			itemdata: [
				{ text: "About", url: "../company.html" },
				{ text: "Contact", url: "../contact.php" },     
				{ 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();
});

