I'm trying to create a countdown table.
Here is the code that I'm using for it.
My Field 3 and Field 4 are working however, Field 2 reads NaN instead of the number of days left.
Could someone take a look and advise something
(also.. I'm a moron at JavaScript.. my boss asked me to do this.. so when you reply could you dumb it down a bit

).
Cheers
- Req
<script Language="JavaScript">
var timerID = null;
var timerRunning = false;
var date1 = "April 2nd, 2004"
var date2 = "May 28th, 2004"
function stopclock ()
{
if(timerRunning) clearTimeout(timerID);
timerRunning = false;
}
function startclock ()
{
// Make sure the clock is stopped
stopclock();
showtime();
}
function showtime ()
{
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var date = now.getDate();
var month = now.getMonth() + 1;
var year = now.getYear();
if (year < 1000) year+=1900
var timeValue = "" + ((hours < 10 ) ? "0" : "") + hours
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
document.clock.face.value = timeValue + " " + date + "/" + month + "/" + year;
nextDate = new Date(date1)
msPerDay = 24 * 60 * 60 * 1000 ; // Number of milliseconds per day
daysLeft = (nextDate.getTime() - now.getTime()) / msPerDay;
daysLeft = Math.round(daysLeft);
document.Frame2.Date1.value = daysLeft + " days until Alpha - " + date1;
nextDate = new Date(date2)
msPerDay = 24 * 60 * 60 * 1000 ; // Number of milliseconds per day
daysLeft = (nextDate.getTime() - now.getTime()) / msPerDay;
daysLeft = Math.round(daysLeft);
document.Frame3.Date2.value = daysLeft + " days until Final - " + date2;
daysLeft = (nextDate.getTime() - now.getTime()) / 1000;//msPerDay;
daysLeft = Math.round(daysLeft);
document.Frame4.Date3.value = daysLeft + " seconds until Final Submission";
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
</script>