I'll call a script using the code below

<script src="testscript.cfm"></script>


The script is below, I would like to set the first 5 variables to a date stored in a database. Is it possibel to pass parameters to the script, or maybe use ColdFusion in the script to get the data out the table? If so how?

Thanks



var yr=2002
var mo=8;
var da=10;
var ho=19;
var mi=50;

function countdown()
{
var today = new Date();
var todayy = today.getYear();

if(todayy < 1000)
{
todayy += 1900;
}

var todaym = today.getMonth();
var todayd = today.getDate();
var todayh = today.getHours();
var todaymin = today.getMinutes();
var todaysec = today.getSeconds();
var todaystring = todaym+"/"+todayd+"/"+todayy+" "+todayh+":"+todaymin+":"+todaysec;

futurestring = (mo-1)+"/"+da+"/"+yr+" "+ho+":"+mi+":"+"00";

dd = Date.parse(futurestring)-Date.parse(todaystring);
dday = Math.floor(dd/(60*60*1000*24)*1);
dhour = Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1);
dmin = Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);
dsec = Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1);

if(document.getElementById)
{
if(dsec <= 0 && dmin <= 0 && dday <= 0)
{
//When countdown ends!!

var countdownDiv = document.getElementById("countdown");
countdownDiv.innerHTML = "<b><div class='small'><font color='red'>Times Up!
Please Draft</font></div></b>";


}
//if on day of occasion
else if(todayy == yr && todaym == (mo-1) && todayd == da)
{
// need to handle this!!

var countdownDiv = document.getElementById("countdown");
countdownDiv.innerHTML = "<b>" + dmin + "</b> m <b>" + dsec + "</b> s ";

setTimeout("countdown()",1000)
}
//else, if not yet
else
{
var countdownDiv = document.getElementById("countdown");
countdownDiv.innerHTML = "<font color=#990000><b>" + dday + "</b> days</font> <b> " + dhour + "</b> h <b>" + dmin + "</b> m <b>" + dsec + "</b>";

setTimeout("countdown()",1000)
}
}
}

if(document.getElementById)
{
document.write("<div id=countdown></div>");
document.write("
");

countdown();
}
else
{
document.write("
");
document.write("<div></div>");
document.write("
");
}