Welcome Your Visitors

Greeting,Day, Date and Seasonal Message

 

This code is valid for 1999 and can be updated for subsequent years. You will need to edit some of the calendar dates for holidays or events that don't fall on the same date every year. For example Thanksgiving in 1999 falls on the 25th of November. In 2000, it will fall on a different date. So edit the code in the "function november(date) {"

if(date==25)
               date_statement="Happy Thanksgiving.";

Change the 23 to the new date.

You can also add new events to the script by going to the month function and adding a new compare of the date and adding a new date_statement. If you want to delete an event, just remove the date compare and the date_statement line.

Add this code to the Head Tag Area:

<SCRIPT LANGUAGE="JavaScript">

<!-- Hide the script from non-Javascript browsers

/*** Visit Netcue at http://netcue.com ***/

var date_statement="";

var time_statement="";

var today=new Date();

var month="";

var day="";

 

function todays_date() {

var month=today.getMonth();

var day_of_week=today.getDay();

date_statement=""

document.month=""

month++;

if(month==1) {

january(today.getDate());

document.month="January";

}

if(month==2) {

february(today.getDate());

document.month="February";

}

if(month==3) {

march(today.getDate());

document.month="March";

}

if(month==4) {

april(today.getDate());

document.month="April";

}

if(month==5) {

may(today.getDate());

document.month="May";

}

if(month==6) {

june(today.getDate());

document.month="June";

}

if(month==7) {

july(today.getDate());

document.month="July";

}

if(month==8) {

august(today.getDate());

document.month="August";

}

if(month==9) {

september(today.getDate());

document.month="September";

}

if(month==10) {

october(today.getDate());

document.month="October";

}

if(month==11) {

november(today.getDate());

document.month="November";

}

if(month==12) {

december(today.getDate());

document.month="December";

}

document.day=""

if(day_of_week==0)

document.day="Sunday";

if(day_of_week==1)

document.day="Monday";

if(day_of_week==2)

document.day="Tuesday";

if(day_of_week==3)

document.day="Wednesday";

if(day_of_week==4)

document.day="Thursday";

if(day_of_week==5)

document.day="Friday";

if(day_of_week==6)

document.day="Saturday";

}

 

function january(date) {

if(date==1)

date_statement="Happy New Year!";

if(date==18)

date_statement="Today's Martin Luther King, Jr.'s Birthday.";

}

function february(date) {

if(date==2)

date_statement="Today's Groundhog Day.";

if(date==12)

date_statement="Today's Lincoln's Birthday.";

if(date==14)

date_statement="Happy Valentine's Day.";

if(date==15)

date_statement="Today's Presidents Day.";

if(date==22)

date_statement="Today's Washington's Birthday.";

}

 

function march(date) {

if(date==21)

date_statement="Today's The First Day of Spring.";

}

 

function april(date) {

if(date==1)

date_statement="Today's April Fool's Day.";

if(date==4)

date_statement="Tonight Daylight Savings Time Begins.";

if(date==22)

date_statement="Today's Earth Day.";

if(date==30)

date_statement="Today's Arbor Day.";

 

}

 

function may(date) {

if(date==9)

date_statement="Happy Mother's Day.";

if(date==31)

date_statement="Today's Memorial Day.";

}

 

function june(date) {

if(date==14)

date_statement="Today's Flag Day!";

if(date==20)

date_statement="Happy Father's Day.";

if(date==21)

date_statement="Today's the first day of summer.";

}

 

function july(date) {

if(date==4)

date_statement="Happy 4th of July!";

}

function august(date) {

 

}

 

function september(date) {

if(date==6)

date_statement="Happy Labor Day!";

if(date==23)

date_statement="Today's the First Day of Autumn.";

}

function october(date) {

if(date==12)

date_statement="Today's Columbus Day.";

if(date==31)

date_statement="Happy Halloween. Tonight Daylight Savings Time Ends.";

}

function november(date) {

if(date==2)

date_statement="Today's Election Day.";

if(date==11)

date_statement="Today's Veterans Day.";

if(date==25)

date_statement="Happy Thanksgiving.";

}

function december(date) {

if(date==7)

date_statement="Today's Pearl Harbor Day.";

if(date>=14)

date_statement="Happy Holiday.";

if(date==22)

date_statement+="Today's The First Day of Winter.";

if(date==31)

date_statement="Tonight's New Years Eve!";

}

 

function time_of_day() {

var time=today.getHours();

time_statement=""

if(time>=5 && time<=11)

time_statement="Good Morning."

if(time>11 && time<=17)

time_statement="Good Afternoon."

if(time>17 || time<5)

time_statement="Good Evening. "

}

// -- End Hiding Here -->

</SCRIPT>

And add this code to the Body Tag Area:

<SCRIPT language="JavaScript">

<!-- Hide the script from non-Javascript browsers

time_of_day();

todays_date();

document.writeln("<CENTER><DT><HR>"+time_statement+" Today is "+document.day+", "+document.month+" "+today.getDate()+". "+date_statement+"<DT><HR></CENTER><P>")

// -- End Hiding Here -->

</SCRIPT>

End of Code.

Return to Netcue Homepage