function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function menuover(){
	var items = document.getElementById("menu").getElementsByTagName("li");
	for(var i=0;i<items.length;i++){
		var imagen = items[i].firstChild.firstChild;
		imagen.onmouseover = function(){
		    if(this.getAttribute("original")== null)
		    {
		        this.setAttribute("original", this.src);
			    this.setAttribute("original_onn", this.src.replace("off","onn"));
			}
			this.src = this.getAttribute("original_onn");
		}
		imagen.onmouseout = function(){
		    if(this.getAttribute("original")!=null)
			    this.src = this.getAttribute("original");
		}
	}
}

addLoadEvent(menuover);// JavaScript Document