adding javascript for the overlay