Then, since we are handling multiple images, you have to pass in the image reference to repeat calls of function to change the alpha of the image. here

setTimeout("function_to_change_alpha("+img+")",interval);

doesnt work. (for reasons beyond my comprehension about javascript quirks.)
the rightway to do it is, by using closure:

setTimeout(function() {function_to_change_alpha(img);}, interval);

For unknown reasons, i couldn't read the opacity property of the object (image) thus passed.mOpacity = obj.style.opacity;didn't work.
I had to pass in the current opacity value also, to the function and increment it in the function.