var speed = 3;
var which = 0;
var cfx = "slideshow";
var preload=new Array();

for (i=0; i<imgArray.length; i++) {
    preload[i]=new Image();
    preload[i].src=imgArray[i];
}

function switchWhich() {
    if (which < imgArray.length-1) {
        which++;
    } else {
        which = 0;
    }
}

function play() { 
    switchWhich();
    if (document.all) {
        document.images[cfx].filters.blendTrans.apply();
        document.images[cfx].src = imgArray[which];
        document.images[cfx].filters.blendTrans.play();
    } else {
        document.images[cfx].src=imgArray[which];
    }
    if (document.all)
        setTimeout("play()", speed*1000+3000);
    else
        setTimeout("play()", speed*1000);
}
play();