I am looking for a way to capture the top-level category from the child categories or grandchild categories. What is the best way to do this. I am working on a client site that is using the categories tag to show the top level categories from a weblog and then applying a class of selected to that element. The problem is when the child categories are selected. Then the selected class of the top-level elements is lost. Any ideas?