There are a lot of tutorials on the internet how you can create your slideshow using JScript.
Just follow one of them.
On this website you will find very detailed explanation of each code is for about for making a slideshow with JScript. Its have 6 pages who will teach you step by step how to do it. Follow all the steps and you will make very easy your slideshows.