window.addEvent('domready', function() {	
	var menuitems = $('mainmenu').getElements('a').get('id'); //get everything under 'main menu' which has an anchor tag, and get the id name

	menuitems.each(function(item, index){  ///for each array item
		var anotherEl = $(menuitems[index]);
		var morph = new Fx.Morph(menuitems[index]);	
		//use Element.morph
		$(menuitems[index]).addEvent('mouseenter', function(e) {
			e.stop();
			// Changes the element's style to .myClass defined in the CSS
			anotherEl.morph('.mainmenuHover');
		});	
		$(menuitems[index]).addEvent('mouseout', function(e) {
			e.stop();
			// Changes the element's style to .myClass defined in the CSS
			anotherEl.morph('.mainmenuLink');
		});	
	});
	
});