Since we have no control over the PHP code that generates the HTML and we sometimes need the links in a dropdown format this js gist was created.
This takes 2 parameters the first one should stay "cats" for now as this is what the PHP code generates but I left it as an option just in case it changes. The second parameter is the id of the element that the drop down should be placed in.
Note: the "class" name here
<div class="cats">
<?php echo getCategoriesForStore($store, true);?>
</div>
Note: the "id" name here
<div id="catDropdown"></div>
a = new Categories('cats', 'catDropdown');
to something like
a = new Categories('class name from Categories Wrapper', 'id from Categories Dropdown Container');