Added JavaScript to deal with mobile and hover states