I've got this bit of javascript I use to change an image to another image when the mouse goes over it. But i've got a special situation where I need the image to stay in the mouseover state while over certain links, then goes back to normal. The code I have now changes the image on mouseover, but doesnt change it back. I can make the image change to the original, however, when the mouse moves from the image, it changes immediatly. I only want it to go back to normal when the drop down menu dissappears.Heres the broken example
<script type="text/javascript"> function init() { if (!document.getElementById) return var imgOriginSrc; var imgTemp = new Array(); var imgarr = document.getElementsByTagName('img'); for (var i = 0; i < imgarr.length; i++) { if (imgarr[i].getAttribute('hsrc')) { imgTemp[i] = new Image(); imgTemp[i].src = imgarr[i].getAttribute('hsrc'); imgarr[i].onmouseover = function() { imgOriginSrc = this.getAttribute('src'); this.setAttribute('src',this.getAttribute('hsrc')) } } } } onload=init;</script>