window.onload = function() { // Mouseovers imgIds = new Array("loc", "fre", "tan", "rep"); for (i = 0 ; i < imgIds.length ; i++) { mouse(i); } } // End onload function mouse(i) { if (document.attachEvent) { //For Internet Explorer document.getElementById(imgIds[i]).attachEvent("onmouseover", function() { document.getElementById(imgIds[i]+"span").style.backgroundPosition = "bottom"; }); document.getElementById(imgIds[i]).attachEvent("onmouseout", function() { document.getElementById(imgIds[i]+"span").style.backgroundPosition = "top"; }); } //End if if (document.addEventListener) { //For everyone document.getElementById(imgIds[i]).addEventListener("mouseover", function() { document.getElementById(imgIds[i]+"span").style.backgroundPosition = "bottom"; }, false); document.getElementById(imgIds[i]).addEventListener("mouseout", function() { document.getElementById(imgIds[i]+"span").style.backgroundPosition = "top"; }, false); } //End If } // End function mouse