Hey Everybody,


I'm having trouble figuring out how to use timing. I'm trying to use setInterval to do multiple timed swaps before clearing the interval at the end of each if or else if statement.
Any thoughts? I was thinking about trying to do this with getSeconds but I don't know how to tell the Javascript to execute the function repeatedly for each .25 seconds.

Here is my code so far, this is just the head script.


HTML Code:
<SCRIPT type="text/javascript">


Image1 = new Image(40,40)
Image1.src = "images/ad/adir001t.jpg"
Image2 = new Image(40,40)
Image2.src = "images/ad/adir001t2.jpg"
Image3 = new Image(40,40)
Image3.src = "images/ad/adir002t.jpg"
Image4 = new Image(40,40)
Image4.src = "images/ad/adir002t2.jpg"
Image5 = new Image(40,40)
Image5.src = "images/ad/adir003t.jpg"
Image6 = new Image(40,40)
Image6.src = "images/ad/adir003t2.jpg"
Image7 = new Image(40,40)
Image7.src = "images/ad/adir004t.jpg"
Image8 = new Image(40,40)
Image8.src = "images/ad/adir004t2.jpg"
Image9 = new Image(40,40)
Image9.src = "images/ad/adir005t.jpg"
Image10 = new Image(40,40)
Image10.src = "images/ad/adir005t2.jpg"
Image11 = new Image(40,40)
Image11.src = "images/ad/adir006t.jpg"
Image12 = new Image(40,40)
Image12.src = "images/ad/adir006t2.jpg"
Image13 = new Image(40,40)
Image13.src = "images/ad/adir007t.jpg"
Image14 = new Image(40,40)
Image14.src = "images/ad/adir007t2.jpg"
Image15 = new Image(40,40)
Image15.src = "images/ad/adir008t.jpg"
Image16 = new Image(40,40)
Image16.src = "images/ad/adir008t2.jpg"
Image17 = new Image(40,40)
Image17.src = "images/ad/adir009t.jpg"
Image18 = new Image(40,40)
Image18.src = "images/ad/adir009t2.jpg"
Image19 = new Image(40,40)
Image19.src = "images/ad/adir010t.jpg"
Image20 = new Image(40,40)
Image20.src = "images/ad/adir010t2.jpg"
Image21 = new Image(40,40)
Image21.src = "images/ad/adir011t.jpg"
Image22 = new Image(40,40)
Image22.src = "images/ad/adir011t2.jpg"
Image23 = new Image(40,40)
Image23.src = "images/ad/adir012t.jpg"
Image24 = new Image(40,40)
Image24.src = "images/ad/adir012t2.jpg"
Image25 = new Image(40,40)
Image25.src = "images/ad/adir013t.jpg"
Image26 = new Image(40,40)
Image26.src = "images/ad/adir013t2.jpg"
Image27 = new Image(40,40)
Image27.src = "images/ad/adir014t.jpg"
Image28 = new Image(40,40)
Image28.src = "images/ad/adir014t2.jpg"
Image29 = new Image(40,40)
Image29.src = "images/ad/adir015t.jpg"
Image30 = new Image(40,40)
Image30.src = "images/ad/adir015t2.jpg"
Image31 = new Image(40,40)
Image31.src = "images/ad/adir016t.jpg"
Image32 = new Image(40,40)
Image32.src = "images/ad/adir016t2.jpg"
Image33 = new Image(40,40)
Image33.src = "images/ad/adir017t.jpg"
Image34 = new Image(40,40)
Image34.src = "images/ad/adir017t2.jpg"
Image35 = new Image(40,40)
Image35.src = "images/ad/adir018t.jpg"
Image36 = new Image(40,40)
Image36.src = "images/ad/adir018t2.jpg"
Image37 = new Image(40,40)
Image37.src = "images/ad/adir019t.jpg"
Image38 = new Image(40,40)
Image38.src = "images/ad/adir019t2.jpg"
Image39 = new Image(40,40)
Image39.src = "images/ad/adir020t.jpg"
Image40 = new Image(40,40)
Image40.src = "images/ad/adir020t2.jpg"
Image41 = new Image(40,40)
Image41.src = "images/ad/adir021t.jpg"
Image42 = new Image(40,40)
Image42.src = "images/ad/adir021t2.jpg"
Image43 = new Image(40,40)
Image43.src = "images/ad/adir022t.jpg"
Image44 = new Image(40,40)
Image44.src = "images/ad/adir022t2.jpg"
Image45 = new Image(40,40)
Image45.src = "images/ad/adir023t.jpg"
Image46 = new Image(40,40)
Image46.src = "images/ad/adir023t2.jpg"
Image47 = new Image(40,40)
Image47.src = "images/ad/adir024t.jpg"
Image48 = new Image(40,40)
Image48.src = "images/ad/adir024t2.jpg"
Image49 = new Image(40,40)
Image49.src = "images/ad/adir025t.jpg"
Image50 = new Image(40,40)
Image50.src = "images/ad/adir025t2.jpg"
Image51 = new Image(40,40)
Image51.src = "images/ad/adir026t.jpg"
Image52 = new Image(40,40)
Image52.src = "images/ad/adir026t2.jpg"
Image53 = new Image(40,40)
Image53.src = "images/ad/adir027t.jpg"
Image54 = new Image(40,40)
Image54.src = "images/ad/adir027t2.jpg"
Image55 = new Image(40,40)
Image55.src = "images/ad/adir028t.jpg"
Image56 = new Image(40,40)
Image56.src = "images/ad/adir028t2.jpg"
Image57 = new Image(40,40)
Image57.src = "images/ad/adir029t.jpg"
Image58 = new Image(40,40)
Image58.src = "images/ad/adir029t2.jpg"
Image59 = new Image(40,40)
Image59.src = "images/ad/adir030t.jpg"
Image60 = new Image(40,40)
Image60.src = "images/ad/adir030t2.jpg"
Image61 = new Image(40,40)
Image61.src = "images/ad/adir031t.jpg"
Image62 = new Image(40,40)
Image62.src = "images/ad/adir031t2.jpg"
Image63 = new Image(40,40)
Image63.src = "images/ad/adir032t.jpg"
Image64 = new Image(40,40)
Image64.src = "images/ad/adir032t2.jpg"
Image65 = new Image(40,40)
Image65.src = "images/RNavArrow.jpg"
Image66 = new Image(40,40)
Image66.src = "images/RNavArrow2.jpg"
Image67 = new Image(40,40)
Image67.src = "images/LNavArrow.jpg"
Image68 = new Image(40,40)
Image68.src = "images/LNavArrow2.jpg"
Image69 = new Image(40,40)
Image69.src = "images/PlaceHolder.jpg"



function SwapOut1(num,real) {
bnum = real
document.images[num].src = eval("Image"+bnum+".src")
}

function SwapBack1(num,real) {
bnum = real
document.images[num].src = eval("Image"+bnum+".src")
}

function wholeSwap(num,real) {
real=znum
document.images[num].src = eval("Image"+znum+".src")
}

function cascade(cnum){
var cnum

if (cnum=1) {
        var a = setInterval('wholeSwap(4,1)',0);
        var b = setInterval('wholeSwap(5,3)',250);
        var c = setInterval('wholeSwap(6,5)',500);
        var d = setInterval('wholeSwap(7,7)',750);
        var e = setInterval('wholeSwap(8,9),1000);
        var f = setInterval('wholeSwap(9,11),1250);
        var g = setInterval('wholeSwap(10,13)1500);
        var h = setInterval('wholeSwap(11,15),1750);
        var i = setInterval('wholeSwap(12,17),2000);
        var j = setInterval('wholeSwap(13,19),2250);
        var k = setInterval('wholeSwap(14,21),2500);
        var l = setInterval('wholeSwap(15,23),2750);
        var m = setInterval('wholeSwap(16,25),3000);
        var n = setInterval('wholeSwap(17,27),3250);
        var o = setInterval('wholeSwap(18,29),3500);
        var p = setInterval('wholeSwap(19,65),3750);
        var q = setInterval('clearInterval()',4000);
       }

else if (cnum=2) {
        var a = setInterval('wholeSwap(4,67)',0);
        var b = setInterval('wholeSwap(5,31)',250);
        var c = setInterval('wholeSwap(6,33)',500);
        var d = setInterval('wholeSwap(7,35)',750);
        var e = setInterval('wholeSwap(8,37),1000);
        var f = setInterval('wholeSwap(9,39),1250);
        var g = setInterval('wholeSwap(10,41)1500);
        var h = setInterval('wholeSwap(11,43),1750);
        var i = setInterval('wholeSwap(12,45),2000);
        var j = setInterval('wholeSwap(13,47),2250);
        var k = setInterval('wholeSwap(14,49),2500);
        var l = setInterval('wholeSwap(15,51),2750);
        var m = setInterval('wholeSwap(16,53),3000);
        var n = setInterval('wholeSwap(17,55),3250);
        var o = setInterval('wholeSwap(18,57),3500);
        var p = setInterval('wholeSwap(19,65),3750);
        var q = setInterval('clearInterval()',4000);
       }

else {
        var a = setInterval('wholeSwap(4,67)',0);
        var b = setInterval('wholeSwap(5,59)',250);
        var c = setInterval('wholeSwap(6,63)',500);
        var d = setInterval('wholeSwap(7,69)',750);
        var e = setInterval('wholeSwap(8,69),1000);
        var f = setInterval('wholeSwap(9,69),1250);
        var g = setInterval('wholeSwap(10,69)1500);
        var h = setInterval('wholeSwap(11,69),1750);
        var i = setInterval('wholeSwap(12,69),2000);
        var j = setInterval('wholeSwap(13,69),2250);
        var k = setInterval('wholeSwap(14,69),2500);
        var l = setInterval('wholeSwap(15,69),2750);
        var m = setInterval('wholeSwap(16,69),3000);
        var n = setInterval('wholeSwap(17,69),3250);
        var o = setInterval('wholeSwap(18,69),3500);
        var p = setInterval('wholeSwap(19,69),3750);
        var q = setInterval('clearInterval()',4000);
       }

}



</script>