Paul I have implemented your changes and they all work!
After looking at that article I agree the easiest fix seems to be the wrapper.
Thanks a lot for your time and patience.
I learned a lot but also realized how much more there is to learn, especially with javascript!
I will close the other question in the javascript forums as you have solved it here.