Hey everyone is there a way in which I could optimize my code with
just one for loop (see code below). I've come across this issue a few
times now and haven't found a solution as yet.. As you can see from
the code below I'm reusing the same loop throughout three functions, I
basically see this as a waste. Is there a more efficient way where I
could use the for loop just the once.

var overStates = [
['0','imgs/membersHome/set01Over.jpg', 'imgs/membersHome/
set01Up.jpg'],
['1','imgs/membersHome/set02Over.jpg', 'imgs/membersHome/
set02Up.jpg'],
['2','imgs/membersHome/set03Over.jpg', 'imgs/membersHome/
set03Up.jpg'],
];

function imgState(event){
var target = getTarget(event, 'a'), i;
for(i = 0; i < overStates.length; i++){
amyObj.removeImgStates(i, 2);
if(overStates[i][0] == target.firstChild.name){
target.firstChild.src = overStates[i][1];
}
}
}

function overState(event){
var target = getTarget(event, 'a'), i;
for(i = 0; i < overStates.length; i++){
if(overStates[i][0] == target.firstChild.name){
target.firstChild.src = overStates[i][1];
}
}
}

function outState(event){
var target = getTarget(event, 'a'), i;
for(i = 0; i < overStates.length; i++){
if(overStates[i][0] == target.firstChild.name)
{
target.firstChild.src = overStates[i][2];
}
}

}

Cheers!

DoomedLung