javascript/HTML mouseover vs. "component-under" : I have some HTML (generated by jsf) that includes images. The user trigger some changes (ajax-calls) when clicking on an image or by pressing a key.

To keep track of the latest image-component (client-side), I use javascript and onmouseover, assigning the img-id to a javascript-variable which in turn is used to fill the ajax-calls.

Everything works well (even it there might be better ways to do it), but sometimes it takes some time to refresh the image. For a moment, the place is empty, the next-to-right picture *jumps* left, getting under the mouse pointer, triggering the mouseover event. Worse, when the original image is displayed, it fails to trigger the mouseover, so the next operation will get the wrong image a argument.

I don't think this has to do with jsf and ajax but could also happen with plain HTML and javascript, so I'm not adding tags jsf nor ajax.

Question is: how can I prevent this *unwanted feature*?