Tracking user's time spent on a div with Javascript