function observe(target, type, listener) {
    if (target.addEventListener) target.addEventListener(type, listener, false);
    else if (target.attachEvent) target.attachEvent('on' + type, function() { listener.call(target, window.event); });
    else target['on' + type] = function(e) { listener.call(target, e || window.event); };
}

function overSet(){
	this.src = this.src.replace('\.png','_o\.png');
	this.src = this.src.replace('\.jpg','_o\.jpg');
	this.src = this.src.replace('\.jpeg','_o\.jpeg');
	this.src = this.src.replace('\.gif','_o\.gif');
}

function outSet(){
	this.src = this.src.replace('_o','');
}

function naviSet(navi){
	observe(document.getElementById(navi), 'mouseover', overSet);
	observe(document.getElementById(navi), 'mouseout', outSet);
}

window.onload = function(){
	naviSet("menu1");
	naviSet("menu2");
	naviSet("menu3");
	naviSet("menu4");
	naviSet("menu5");
	naviSet("menu6");
	naviSet("menu7");
	naviSet("menu8");
}
