Since I am new to the forum, it won't let me post anything. I tried several different versions, it kept saying post denied.

In any case I've posted to StackOverflow but the question is too specialized, and I don't expect anyone there to be able to help me.

The question is here:

If anyone can look at it and even point me as to where to look, it'll be a great help.