home *** CD-ROM | disk | FTP | other *** search
- /******** Create the News Worthy Event List *******
- **
- ** This script builds datastructures for all the
- ** messages and the effective date of that message
- **
- **************************************************/
- var w_n_date = new Array() //this is the what's new date field
- var w_n_msg = new Array() //this is the what's new message
- var i = new Number(0) //index should be same for date and message
- var news = new Number(0) //counter of what's new hits
-
- /**
- *** To add an event, copy the line below and modify as appropriate
- *** 1) remove the '//' comment
- *** 2) add the date in yyyymmdd (number only) format
- *** 3) add an appropriate message
- **/
- //w_n_date[i] = 19990301; w_n_msg[i++]= 'your msg here'
-
- // what's new events
- w_n_date[i] = 19990301; w_n_msg[i++]= 'This Site went live';
- w_n_date[i] = 19990315; w_n_msg[i++]= 'The colors were changed';
- w_n_date[i] = 19990406; w_n_msg[i++]= 'Registration for our sweepstakes began';
- w_n_date[i] = 19990503; w_n_msg[i++]= 'Winners were selected in the sweepstakes giveaway';
-
- function whats_new(since_date)
- {
- num_events = new Number(w_n_date.length)
- last_visit = new Number(since_date)
- if (last_visit == 99999999) msg = new String('<h3>Here\'s What\'s New at this Site</h3><ul>')
- else msg = new String('<h3>Here\'s what\'s new since your last visit on ' + last_visit + '</h3><ul>')
-
- for (cnt = 0; cnt < num_events; cnt++)
- {
- //any new events since their last visit?
- if (last_visit < Number(w_n_date[cnt]) || (last_visit == 99999999) )
- {
- msg += '<li>On ' + w_n_date[cnt] + ' ' + w_n_msg[cnt] + '</li>'
- news++;
- }
- }
- msg += '</ul>'
- if (news == 0) msg = ''
- return msg
- }