Here is some of my JavaScript code:
var run;
var countdown;
var count =14;
var curImage = 1;
function startAdPage() {
run = setInterval("changeAd()"5000);
countdown = setInterval("startCountdown()",1000);
}
function changeAd {
switch (curImage) {
case 1:
document.images[0].src = "cvb2.gif";
curImage = 2;
break;
case 2:
document.images[1].src = "cvb3.gif";
curImage = 3;
break;
case 3:
document.images[2].src = "cvb1.gif";
curImage = 1;
break;
}
}
function startCountdown() {
document.advertisement.ads.value = count;
--count;
if (0==count;)
window.clearInterval(countdown);
window.clearInterval(run);
count=14;
location.href = "crv2.htm";
}
}
This is a form/table I am working on:
<form name="advertisement" method="">
<table>
<tr>
<td><img src="cvb1.gif"></td>
<td>
<p><b><center>Advertisement</center></b></p>
<p><center>The Central Valley Realtors home page will be displayed in <input type="text" name="ads" value="15" size="4" /> seconds.</center></p>
<p><center><a href="cvr2.html">Skip advertisement</a></center></p>
</td>
</tr>
</table>
</form>
The text field does not seem to be counting down. Can you help me figure out what's wrong with the code?