

	// on dom ready
//	window.addEvent('domready', function(){

// not on dom ready, the script is now included just after the menu HTML as otherwise IE showed the subitems for a split second

		// initialize menu accordion
		var accordion = new Accordion('h3.menuheader.expandable', 'ul.categoryitems',
		{
			display: false,
			opacity: false,
			onActive: function(toggler, element)
			{
				toggler.addClass('active');
			},
			onBackground: function(toggler, element)
			{
				toggler.removeClass('active');
			}
		});

		// revealing the active item's subitems without effect
		var activeItemWithSubs, activeCategoryitems;
		if (activeItemWithSubs = $$('h3.menuheader.expandable.active')[0])
		{
			activeCategoryitems = activeItemWithSubs.getNext();
			activeCategoryitems.setStyle('height', activeCategoryitems.scrollHeight);
		}

		// making the subitems to become active onclick; quench all others
		$$('ul.categoryitems li').each(function(subItem){
			subItem.addEvent('click', function(){
				$$('ul.categoryitems li').each(function(subItem){
					subItem.removeClass('active');
				});
				this.addClass('active');
			});
		});

//	});

