// JavaScript Document

//-------------- Change the following to customize your slide show ------------------

var imgName  = "images/img_home";                      //URL of the images
var imgType  = ".jpg";                             //type of image .gif, .jpg or .png
var total    =  2;                                //total number of images
var next     =  2;                                 //start image number
var repeat   =  true;                              //continue loop? true or false
var interval =  10000;                              //interval 10 second

//-------------- Do not alter the code below ----------------------------------------

var picArray = new Array();                        //Create Array to store images

for (var i = 1; i <= total; i++) {
    picArray[i]     =  new Image();                //Create an Image object 
    picArray[i].src = imgName + i + imgType;       //Load object with the .jpg file
}

function run() {
    document.slideShow.src = picArray[next].src;   //Move next image into slideShow
    next = next+1;
    if (repeat && next > total)                    //if repeat is requested
        next = 1;                                  //reset number to 1
    if (next > total)                    
        clearInterval(timer);                      //stop the show
}

function move(direction) {
    next += direction;
    if (next > total)
        next = 1;
    if (next < 1)
        next = total;
    document.slideShow.src = picArray[next].src;   //Move next image into slideShow
}