I've implemented this script rather than the Switch Content Script for the sitewide perstistance, however I would like to know if and how it would be possible to get it to close the previously opened sub menu when a new menu item is clicked like with the collapseprevious.