woozle-scoreboard/res/adverts.js

31 lines
523 B
JavaScript
Raw Normal View History

2013-06-08 12:45:18 -06:00
var advert_num = 100
var advert_itimer
function adverterror() {
if (advert_num > 1) {
advert_num = 1
rotate_advert()
} else {
var e = document.getElementById("advert")
clearInterval(advert_itimer)
e.style.visibility = "hidden"
}
}
function rotate_advert() {
var e = document.getElementById("advert")
var sn
if (advert_num < 10) {
sn = "0" + advert_num
} else {
sn = advert_num
}
2013-06-13 18:39:03 -06:00
e.src = "ads/ad" + sn + ".jpg"
2013-06-08 12:45:18 -06:00
advert_num = advert_num + 1
}
advert_itimer = setInterval(rotate_advert, 15000)