Check out
Advanced Templates: Dynamic Templates Changing according to different conditions by Logician.
It gives you tremendous power and flexibility in how you present your templates, and since I've installed it I've found many similar uses for it.
If you have any questions on how to use it for this particular application, may I suggest you post in the thread supplied above for assistance.
Take care,
2 X