// JScript File var interval; var CurrentSeconds=0; var CurrentImg = 0; var imgArray = new Array(7); imgArray[0] = 'images_topbanner/BackCreek_1.jpg'; imgArray[1] = 'images_topbanner/BackCreek_2.jpg'; imgArray[2] = 'images_topbanner/Mattawoman_1.jpg'; imgArray[3] = 'images_topbanner/PennManor_1.jpg'; imgArray[4] = 'images_topbanner/PennManor_2.jpg'; imgArray[5] = 'images_topbanner/Running_creek_1.jpg'; imgArray[6] = 'images_topbanner/Storage_field_1.jpg'; imgArray[7] = 'images_topbanner/Water_drain_1.jpg'; var hashCounter = {}; hashCounter['Banner1'] = 1; hashCounter['Banner2'] = imgArray.length/2; for (i=0; i < imgArray.length; i++) { var preload = new Image(); preload.src = imgArray[i]; } function startCounters() { interval = setInterval("UpdateFreshSeconds(1);UpdateImg('Banner1',1,3);UpdateImg('Banner2',1,3)", 1 * 1000); } function stopCounters() { clearInterval(interval) } function UpdateFreshSeconds(UpdateStep) { CurrentSeconds = CurrentSeconds + 1; } function UpdateImg(imgName,SwapVersion,updateInterval) { var totalPics = imgArray.length; if (CurrentSeconds % updateInterval == 0 && CurrentSeconds > updateInterval) { if (hashCounter[imgName] < (totalPics-1)) { hashCounter[imgName] = hashCounter[imgName] + 1; } else { hashCounter[imgName] = 0; } if (SwapVersion==0) { //swapfade(document.getElementById(imgName), imgArray[CurrentImg], '3', ''); } else { document[imgName].src = imgArray[hashCounter[imgName]]; } } }