updated script.js - automatic reset of slideshow