<script language="JAVASCRIPT">
// <!--
// preload images
var clock1 = new Array();
for(i=0; i < 10; i++) {
clock1 = new Image();
clock1.src = "http://a772.g.akamai.net/7/772/51/524a0405ba2b3c/www.apple.com/home/images/2003/10/clock/" + i + "1.gif"; // take gif out of source name for use with abc
}
var clock2 = new Array();
for(i=0; i < 10; i++) {
clock2 = new Image();
clock2.src = "http://a772.g.akamai.net/7/772/51/524a0405ba2b3c/www.apple.com/home/images/2003/10/clock/" + i + "2.gif"; // take gif out of source name for use with abc
}
var clock3 = new Array();
for(i=0; i < 10; i++) {
clock3 = new Image();
clock3.src = "http://a772.g.akamai.net/7/772/51/524a0405ba2b3c/www.apple.com/home/images/2003/10/clock/" + i + "3.gif"; // take gif out of source name for use with abc
}
var counterd = 1;
var counterdd = 1;
var counterh = 1;
var counterhh = 1;
var counterm = 1;
var countermm = 1;
var counters = 1;
var counterss = 1;
function countdown() {
path = "http://a772.g.akamai.net/7/772/51/524a0405ba2b3c/www.apple.com/home/images/2003/10/clock/"
s = 1; //initialize seconds
// now
var now = new Date()
// then
var then = new Date("October 24, 2003 20:00:00");
var difference = new Date();
difference.setTime(Math.abs(then.getTime() - now.getTime()));
timeDifference = difference.getTime();
// dRemain = Math.ceil((then.getTime() - now.getTime()) / (one_day));
dRemain = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
timeDifference -= dRemain * (1000 * 60 * 60 * 24);
hRemain = Math.floor(timeDifference / (1000 * 60 * 60));
timeDifference -= hRemain * (1000 * 60 * 60);
mRemain = Math.floor(timeDifference / (1000 * 60));
timeDifference -= mRemain * (1000 * 60);
sRemain = Math.floor(timeDifference / 1000);
timeDifference -= sRemain * 1000;
var o=0;
while (dRemain > 9) {
o++;
dRemain = dRemain-10
}
if (document.day.src.indexOf(clock3[o].src) < 0 && counterd < 4) {
document.day.src = eval("clock" + (counterd) + "[" + o + "].src");
counterd++;
} else {
document.day.src = clock3[o].src;
counterd=1;
}
if (document.dayday.src.indexOf(clock3[dRemain].src) < 0 && counterdd < 4) {
document.dayday.src = eval("clock" + (counterdd) + "[" + dRemain + "].src");
counterdd++;
} else {
document.dayday.src = clock3[dRemain].src;
counterdd=1;
}
var p=0;
while (hRemain > 9) {
p++;
hRemain = hRemain-10
}
if (document.hour.src.indexOf(clock3[p].src) < 0 && counterh < 4) {
document.hour.src = eval("clock" + (counterh) + "[" + p + "].src");
counterh++;
} else {
document.hour.src = clock3[p].src;
counterh=1;
}
if (document.hourhour.src.indexOf(clock3[hRemain].src) < 0 && counterhh < 4) {
document.hourhour.src = eval("clock" + (counterhh) + "[" + hRemain + "].src");
counterhh++;
} else {
document.hourhour.src = clock3[hRemain].src;
counterhh=1;
}
var q=0;
while (mRemain > 9) {
q++;
mRemain = mRemain-10
}
if (document.minute.src.indexOf(clock3[q].src) < 0 && counterm < 4) {
document.minute.src = eval("clock" + (counterm) + "[" + q + "].src");
counterm++;
} else {
document.minute.src = clock3[q].src;
counterm=1;
}
if (document.minuteminute.src.indexOf(clock3[mRemain].src) < 0 && countermm < 4) {
document.minuteminute.src = eval("clock" + (countermm) + "[" + mRemain + "].src");
countermm++;
} else {
document.minuteminute.src = clock3[mRemain].src;
countermm=1;
}
var r=0;
while (sRemain > 9) {
r++;
sRemain = sRemain-10
}
if (document.second.src.indexOf(clock3[r].src) < 0 && counters < 4) {
document.second.src = eval("clock" + (counters) + "[" + r + "].src");
counters++;
} else {
document.second.src = clock3[r].src;
counters=1;
}
if (document.secondsecond.src.indexOf(clock3[sRemain].src) < 0 && counterss < 4) {
document.secondsecond.src = eval("clock" + (counterss) + "[" + sRemain + "].src");
counterss++;
} else {
document.secondsecond.src = clock3[sRemain].src;
counterss=1;
}
setTimeout("countdown()",20);
}
//-->
</script>