home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 February
/
PCWorld_2000-02_cd.bin
/
Komunik
/
Webscr
/
HTMLtool
/
_SETUP.1
/
Countdown.scp
< prev
next >
Wrap
Text File
|
1999-06-12
|
2KB
|
45 lines
<HTMLtool>Script that counts down to the year 2000</HTMLtool>
<BODY ONLOAD="startclock()">
this script counts down until the year 2000
<BR>
<FORM NAME="form">
<INPUT TYPE="textarea" NAME="left" SIZE=60 VALUE="">
</FORM><SCRIPT LANGUAGE="JavaScript"><!--
var timerID = null;
var timerRunning = false;
function showtime() {
now = new Date();
var CurHour = now.getHours();
var CurMinute = now.getMinutes();
var CurMonth = now.getMonth();
var CurDate = now.getDate();
var CurYear = now.getYear();
var CurSecond = now.getSeconds();
now = null;
Hourleft = 23 - CurHour
Minuteleft = 59 - CurMinute
Secondleft = 59 - CurSecond
var Yearleft = 99 - CurYear
var Monthleft = 12 - CurMonth - 1
var Dateleft = 31 - CurDate - 1
if (Yearleft!=1) {var ys="s"} else {var ys=""};
if (Monthleft!=1) {var mos="s"} else {var mos=""}
if (Dateleft!=1) {var ds="s"} else {var ds=""}
if (Hourleft!=1) {var hs="s"} else {var hs=""}
if (Minuteleft!=1) {var mis="s"} else {var mis=""}
if (Secondleft!=1) {var ss="s"} else {var ss=""}
Temp=Yearleft+' year'+ys+', '+Monthleft+' month'+mos+', '+Dateleft+' day'+ds+', '+Hourleft+' hour'+hs+', '+Minuteleft+' minute'+mis+', '+Secondleft+' second'+ss
document.form.left.value=Temp;
timerID = setTimeout("showtime()",1000);timerRunning = true;}
var timerID = null;
var timerRunning = false;
function stopclock () {
if(timerRunning) clearTimeout(timerID);
timerRunning = false;}
function startclock () {
stopclock();
showtime();}
// -->
</SCRIPT>
</BODY>