If you are concerned about browser compatibility (and W3C specs) there are several options. There are a
lot of rollover scripts available. Placing your script in an external .js file is pretty straightforward. The code that you would normally place inside the <script></script> tags is simply moved to the new file and a <script src="sollover.js> tag is put in its place in the HTML.
It is possible to do the rollovers using only CSS instead of JavaScript. Check out
http://www.edginet.org/techie/website/cssimg.html for some options.