CSS is a better solution.
Just define different "border-right" properties for "a:link" and "a:hover".
You may have a look of the menu of my blog. Although it is not exactly like
what you described, the basic idea is the same.
copy the following code into a text editor, save it as a HTML file, and see
whether it is what you want. I just like to define everything in CSS instead
of in HTML, so the CSS part is a bit long.