Return to main menu after being inactive.

I'm looking for a method to automatically return users to the main menu of a floating menu after a period of inactivity. I haven't found any options for this yet; is it possible to script it?

do you want to close the submenus sometime after the menu is hidden or while they are visible?

I'd like to close the submenu after 3 minutes of not using it while it is still visible.