Reusable JS code for Shareabouts