A simple, reusable Javascript function to create click events for dropdown menus