﻿/* ####################### begins list of images to be used ####################### */
currentIndx = 0;
MyImages = new Array();
MyImages[0] = 'images/LynmouthBay.jpg';
MyImages[1] = 'images/family_room1_225_156_thumb.jpg';
MyImages[2] = 'images/DINING_ROOM_225_156.jpg';
MyImages[3] = 'images/piano_225_156.jpg';
MyImages[4] = 'images/Lounge_Small.jpg';


/* ####################### now we preload the images ####################### */
imagesPreloaded = new Array(4)
for (var i = 0; i < MyImages.length; i++) {
    imagesPreloaded[i] = new Image(200, 133)
    imagesPreloaded[i].src = MyImages[i]
}
/* ####################### we create the functions to go forward and go back ####################### */
function Nexter() {
    if (currentIndx < imagesPreloaded.length - 1) {
        currentIndx = currentIndx + 1;
        document.theImage.src = imagesPreloaded[currentIndx].src

    }
    else {
        currentIndx = 0
        document.theImage.src = imagesPreloaded[currentIndx].src

    }
}
function Backer() {
    if (currentIndx > 0) {
        currentIndx = currentIndx - 1;
        document.theImage.src = imagesPreloaded[currentIndx].src

    }
    else {
        currentIndx = 3
        document.theImage.src = imagesPreloaded[currentIndx].src

    } 
}
function automaticly() {

    if (currentIndx < imagesPreloaded.length) {
        currentIndx = currentIndx
    }
    else {
        currentIndx = 0
    }
    document.theImage.src = imagesPreloaded[currentIndx].src

    currentIndx = currentIndx + 1;
    var delay = setTimeout("automaticly()", 3500)

}
/* <!-- ####################### end of image slide show code ####################### --> */