OK, I don't know anything about Java Script and am not a programmer, but I
found some code that I wanted that would give me a live countdown timer on my
website. I followed the directions from the site where I got the code and
previewed it in Firefox. It worked! Yea!. I uploaded it to my site as a test
page, along with the two scripts it required, and it continued to work in
Firefox. I ran over to our PC, only used for this type of heavy lifting, and it
worked there too. Unfortunately, when viewed on Safari, nothing showed up.:-(
Coming from a print background, this web kind of vodoo drives me crazy.

Can someone please provide me a fix? I know that it's only a small number of
web users out there who use Safari, but I'd like not to exclude them,
especially because I am a Mac enthusiast. And, damn it, it should work...:-)

The page can be viewed here: [url]www.hyperflite.com/indextest.html[/url]. The timer is
supposed to appear in the yellow bar at the top and does so in Firefox.

Here is the first script:

var myCountdown = new Array();
var repeat = false;

function checkPlural(noun, value) {
noun = ((value == 1) || (value == 0)) ? noun : (noun += "s");
return noun;
}

function updateDisplay(text, id) {
var tag = document.getElementById(id);
if (tag.firstChild) {
tag.firstChild.nodeValue = text;
}
else {
textNode = document.createTextNode(text);
tag.appendChild(textNode);
}
return;
}

function doCountdown() {
for (i = 0; i < myCountdown.length; i++) {
if (!myCountdown.expired) {
var currentDate = new Date();
var eventDate = myCountdown.eventDate;
var timeLeft = new Date();
timeLeft = eventDate - currentDate;
msPerDay = 24 * 60 * 60 * 1000;
msPerHour = 60 * 60 * 1000;
msPerMin = 60 * 1000;
msPerSec = 1000;
daysLeft = Math.floor(timeLeft / msPerDay);
hoursLeft = Math.floor((timeLeft % msPerDay) / msPerHour);
minsLeft = Math.floor(((timeLeft % msPerDay) % msPerHour) / msPerMin);
secsLeft = Math.floor((((timeLeft % msPerDay) % msPerHour) % msPerMin) /
msPerSec);
day = checkPlural("day", daysLeft);
hour = checkPlural("hour", hoursLeft);
minute = checkPlural("minute", minsLeft);
second = checkPlural("second", secsLeft);
if ((daysLeft == 0) && (hoursLeft == 0) && (minsLeft == 0) && (secsLeft
== 0)) {
updateDisplay(myCountdown.onevent, myCountdown.tagID);
}
else {
if (daysLeft <= -1) {
updateDisplay(myCountdown.afterevent, myCountdown.tagID);
myCountdown.expired = true;
}
else {
updateDisplay("Only " + daysLeft + " " + day + " " + hoursLeft + " "
+ hour +
" " + minsLeft + " " + minute + " " +
secsLeft + " " + second + " until the " +
myCountdown.event, myCountdown.tagID);
repeat = true;
}
}
}
}
if (repeat) {
repeat = false;
window.setTimeout("doCountdown()", 1000);
}
else {
return;
}
}

function setEventDate(year, month, day, hour, minute, second) {
this.eventDate = new Date(year, month - 1, day, hour, minute, second);
return;
}

function addCountdown(countdown) {
myCountdown[myCountdown.length] = countdown;
return;
}

function Countdown() {
this.tagID = "";
this.eventDate = new Date();
this.setEventDate = setEventDate;
this.event = "";
this.onevent = "";
this.afterevent = "";
this.expired = false;
}

The second script is:

var mycountdown = new Countdown();
with (mycountdown) {
tagID = "mycountdowndiv";
setEventDate(2006, 9, 23, 10, 0, 0);
event = "2006 Hyperflite Skyhoundz World Championship";
onevent = "The moment you have been waiting for...!";
afterevent = "Congratulations 2006 Hyperflite Skyhoundz World Finalists!";
}
addCountdown(mycountdown);

TIA