Definetely a possibility. If you want to post that section of your code in a new topic in the Scripts & Pop-ups forum, I (and I'm quite sure several others) will be happy to look at it and see if we can come up with something better.