What you are describing is pretty complex. I feel I have wrapped my head around the particular scenario, but won't be able to put something together If someone is able to help you out sooner, great.