I have done something like this before...
Let me see if I can find it.