Given time, I would probably simplify this some. But here's a fairly good approach assuming I understand the question:


<pre><!-- see below comment on the closing /pre tag (this is for visual...