
	var defaultDisplay = 0;

	window.addEvent('load', function() {

		// Reset mainmenu display
		$('mm').setStyle('display', 'block');

		// Define how menu items will behave
		$$('a.tm').addEvent('mouseenter', function(){
				if (this.clicked==null) {
					this.origColor=this.getStyle('color');
					this.setStyle('color', '#fff');
				}
			}
		);
		$$('h2').addEvent('mouseenter', function(){
				if (this.clicked==null) {
					this.origColor=this.getStyle('color');
					this.setStyle('color', '#fff');
				}
			}
		);
		$$('li.toggle a').addEvent('mouseleave', function(){
				if (this.clicked==null) {
					this.setStyle('color', this.origColor);
				}
			}
		);
		$$('h2').addEvent('mouseleave', function(){
				if (this.clicked==null) {
					this.setStyle('color', this.origColor);
				}
			}
		);
		$$('li.toggle a').addEvent('click', function(){
				$$('li.toggle a').each(function(el){ el.clicked=null; });
				this.clicked=1;
				this.origColor=this.getStyle('color');
			}
		);

		// Find out which menu element has been selected
		$$('a.tm').each(function(link, i){
			if (link.hasClass('selected')) defaultDisplay = i;
		});

		// Initialize styles
		var bgac = '#042434';
		var bgai = 'transparent url("images/mm/bg.gif") 0 50% no-repeat';
		var bgic = '#cfd8e9';
		var bgii = '#042434';

		if (pvs == 'green') {
			var bgac = '#d7d7d7';
			var bgai = 'transparent url("images/mm/bg_green.gif") 0 50% no-repeat';
			var bgic = '#c9dcde';
			var bgii = '#103236';
		}

		// Initialize menu accordion
		var mainMenuAccordion = new Accordion($('mm'), 'a.tm', 'ul.submenu',	{
			opacity: true,
			display: defaultDisplay,
			onActive: function(toggler, element) {
				toggler.setStyle('color', bgac);
				toggler.setStyle('text-align', 'right');
				toggler.setStyle('background', bgai);
			},
			onBackground: function(toggler, element) {
				toggler.setStyle('color', bgic);
				toggler.setStyle('text-align', 'left');
				toggler.setStyle('background', bgii);
			}
		});

		// Initialize content accordion(s)
		var contentAccordion = new Accordion($('content'), 'h2', 'div.description', {
			opacity: true,
			onActive: function(toggler, element){},
			onBackground: function(toggler, element){}
		});

		// Slide out the subcontent
		if ($('subcontent') != null) {
			var subcontentSlide = new Fx.Slide('subcontent');
			// Internal hiding method -- slide will not animate if not hidden previously
			subcontentSlide.hide();
			// Reset slide's display, it's ready for debut
			$('subcontent').setStyle('display', 'block');
			// Lights, drums, action!
			subcontentSlide.slideIn();
		}

		$('moostick').setStyle('display', 'block');

	});


