I've been gnawing on a similar problem for the past 3 days, and this solves it beautifully. Great post, thank you.