Hard to answer without a bit more information but in general javascript can go in the page itself or in an external file.

Have a look at:

http://www.zen-cart.com/wiki/index.p...s_-_Javascript

None of my business but why use javascript when css does rollovers better and faster?