I need a countdown where it can auto reset after a period of time.

In the html code, i want to be able to edit the time it counts up to and then auto reset after the time is up.

This is for website and a html code so it can work.

I found this:
[CODE]<html>
<head>

<script type = "text/javascript">
// From: http://www.codingforums.com/showthread.php?t=187335 jmrker corrected by Philip M

var cday;
var timeInSecs;
var ticker;

function getSeconds() {
var now = new Date();
var dy = 5 ; // Friday (day 5) - change for other days 0-6 as required
var countdowntime = new Date(now.getFullYear(),now.getMonth(),now.getDate(),16,0,0); // 16 hrs = 4 pm
// countdowntime - change time hh,mm,ss to whatever time required, e.g. 7,50,0 (0750)

var nowtime= now.getTime(); // time now in milliseconds
var atime = countdowntime.getTime(); // countdown time in milliseconds
var diff = parseInt((atime - nowtime)/1000); // positive if countdowntime is in future
if (diff > 0) { cday = dy - now.getDay() }
else { cday = dy - now.getDay() -1 } // already passed countdown time
if (cday < 0) { cday += 7; } // aleady passed countdown time, so go for next week
if (diff <= 0) { diff += (86400 * 7) } // move on one week
startTimer (diff);
}

function startTimer(secs) {
timeInSecs = parseInt(secs);
ticker = setInterval("tick()",1000);
tick(); // to start counter display right away
}

function tick() {
var secs = timeInSecs;
if (secs>0) {
timeInSecs--;
}
else {
clearInterval(ticker); // stop counting at zero
getSeconds(); // and start all over again!
}

var days = Math.floor(secs/86400); // redundant
secs %= 86400;
var hours= Math.floor(secs/3600);
secs %= 3600;
var mins = Math.floor(secs/60);
secs %= 60;
var result = "Time remaining " + cday +' day(s) ';
result += ((hours < 10 ) ? "0" : "" ) + hours + " hours " + ( (mins < 10) ? "0" : "" ) + mins
+ " minutes " + ( (secs < 10) ? "0" : "" ) + secs + " seconds";
document.getElementById("countdown").innerHTML = result;
}
</script>
</head>

<body onload = "getSeconds()">
<span id="countdown" style="font-size: 20; font-weight:bold;" > </span>
</body>
</html>
[CODE]