Let your visitors know how many more days until Christmas. On the day before Christmas, the script indicates that it is Christmas Eve. You may also see how the script reacts to different dates by changing the date on your computer then reloading the script.
Add the below code to the <body> section of your page:
<scriptlanguage="javascript"type="text/javascript"> /* Visit http://www.yaldex.com/
for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin var
day_description ="Christmas"; var
day_before ="Christmas Eve";
var
today =newDate(); var
year =
today.getYear(); if((navigator.appName=="Microsoft Internet Explorer")&&(year
<2000))
year="19"+
year; if(navigator.appName=="Netscape") year=1900+
year; var
date =newDate("December
25, "+
year); var
diff =
date.getTime()-
today.getTime(); var
days =Math.floor(diff
/(1000*60*60*24));
document.write("<center><h3>")
if(days
>1) document.write("There
are "+(days+1)+" days until "+
day_description +"!"); elseif(days
==1) document.write("Tommorrow
is "+
day_before +"!"); elseif(days
==0) document.write("Today
is "+
day_before +"!"); elseif(days
==-1) document.write("It's
"+
day_description +"!"); elseif(days
<-1) document.write(day_description
+" was "+((days+1)*-1)+(days
<-2?" days":" day")+" ago this year!"); document.write("</h3></center>"); // End --> </script>