Personally, I would do it with css only.
Create an image with an anchor:
(The anchor is for the hovering, IE can only hover anchors)
HTML Code:
<a href=";"><img src="img.jpg" width="20" height="20" alt="" /></a>
Give the image a the same color border as the background (for instance, white):
Code:
a img { border: 2px solid #fff; }
Now to the hovering part:
Code:
a:hover img { border: 2px solid #000; }
As you can see, it works well in FF!
As usual, in IE this won't work, so you have to put a little 'hack' on the
a:hover, like this:
Code:
a:hover { color: red; }
Now it works cross-browser without the picture moving!
Good luck.