I went back and tried Richard Greenwwod's original code again using what I've learned about JavaScript in fighting the problem. It now works fine, so I must have been doing something wrong the first time around. Many thanks to Stephen, Steve and Jacob for all the help. -- Richard