js to make new slideshow work