random images from folders..need help.
can someone look at this and tell me why its not working?
Code:
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000
// Duration of crossfade (seconds)
var crossFadeDuration = 3
var t
var img
var iNdx
var sVal
var q = 0
var rpics = 0
var preLoad = new Array()
function loadshow(){
iNdx = Math.round(Math.random() * 3) + 1
for (y=1;y<=4;y++) {
sVal = "images/random" + iNdx + "/"
for (x=1;x<=4;x++) {
img = sVal + "random" + x + ".jpg"
preLoad[rpics] = new Image()
preLoad[rpics].src = img.src
rpics++
iNdx++
}
}
function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply()
}
document.images.SlideShow.src = preLoad[q].src
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play()
}
q = q + 1
if (q > (rpics-1)) q=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}