This is a countdown timer, it changes colors when it gets close to zero.
This should be a decent start.
var start = new Date();
var end = (start.getTime() + (235*1000))
// Note -- 235*1000 above -- 235 is the number of seconds we want the
timer to count down for.
function timer(){
var now = new Date();
var seconds = Math.floor((end - now.getTime()) / 1000)
if (seconds <= 20 && seconds > 10 ) {
document.fgColor="#FFFF00";
}
if (seconds == 10 ) {
document.fgColor="#FFBF00";
}
if (seconds < 10 ) {
document.fgColor="#FF" + seconds + "F00";
}
var minutes = Math.floor(seconds /60)
var seconds = seconds % 60
var minutes = minutes % 60
if (seconds <= 9) seconds = "0" + seconds;
if (seconds >= 0) {
document.getElementById("timer_disp").innerHTML =
minutes + ":" + seconds;
setTimeout("timer()",1000)
}else{
document.fgColor="#444444";
document.getElementById("timer_disp").innerHTML =
"-:--";
setTimeout("reload()", 800)
parent.frames[4].location = "panic.php";
loadPlaylist()
}
}
window.onload = timer;
;
<table border="1" cellspacing="1" cellpadding="1"><tr>
<td bgcolor=#000000 height="85" width="130"><center>
<font face="arial" size="7"><b><span id="timer_disp"></span>
</td></tr></table>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/CefplB/TM
--------------------------------------------------------------------~->
The php_mysql group is dedicated to learn more about the PHP/MySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/