

// 'domready' event, fired when the dom is ready for manipulation:
window.addEvent('domready', function() {
	// To save the execution time of using slice on each hover firstly save the normal img src and the 
	// hover img src on each img:
	$$('#menu a img').each(function(item, index) {
		item.normalSrc = item.getProperty('src');
		item.hoverSrc = item.getProperty('src').slice(0,-4)+'over'+item.getProperty('src').slice(-4);
	});
	// Then add a couple of events to change each img's src:
	$$('#menu a img').addEvents({
		'mouseenter': function(){
			this.setProperty('src', this.hoverSrc);
		},
		'mouseleave': function(){
			this.setProperty('src', this.normalSrc);
		}
	});
});
