Clearly you have a very good knowledge of Javascript.

I'll try out everything you've suggested and let you know how I get on by posting back as soon as possible.

Once again, thank you for your advice. I can't begin to tell you how grateful I am, as the help you have offered has really made a difference.