/***********************************************
* DHTML slideshow script-  © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice must stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var photos = new Array();
var preloadedimages = new Array();
var which = 0;
var intInitLoad = 0;

function setArraySize(size) {
    photos = new Array(size);
    preloadedimages = new Array(size);
}

function addImage(src) {
    photos[intInitLoad] = src;
    intInitLoad++;
}

function applyeffect(effect){
    if (document.all && photoslider.filters){
        photoslider.filters.revealTrans.Transition = effect;
        photoslider.filters.revealTrans.stop();
        photoslider.filters.revealTrans.apply();
    }
}

function playeffect(){
    if (document.all && photoslider.filters) {
        photoslider.filters.revealTrans.play();
    }
}

function backward(){
    if (which<=0) {
        which = photos.length-1;
    } else {
        which--;
    }
    
    applyeffect(7);
    document.images.photoslider.src = photos[which];
    playeffect();
}

function forward(){
    if (which < photos.length-1){
        which++;
    } else {
        which = 0;
    }


    applyeffect(6);
    document.images.photoslider.src = photos[which]
    playeffect();
}

function autoExecInit() {
    setTimeout(autoExec, 10000);
}

function autoExec() {
    forward();
    setTimeout(autoExec, 10000);
}
