<!-- // Hide the script

/*
 * special.js
 *
 * Checks the date and prints important messages corresponding with those dates
 * Michael Lieberman, 2001
 *
 * Date::getYear() fix
 */

// Constants
var MAX_ELEM   = 100; // The maximum number of events that the array can hold
var START_TIME = 0;   // The time to begin displaying events (24hr)
var END_TIME   = 24;  // The time to stop displaying events  (24hr)

var now = new Date();
if(now.getHours() >= START_TIME && now.getHours() < END_TIME)
{

/* Events is the two dimensional array holding the dates and events.
 * For any given i (under MAX_ELEM):
 *   Events[i][0] is the starting date string
 *   Events[i][1] is the ending date string
 *   Events[i][2] is the event string
 */
var Events = new Array(MAX_ELEM);

// "@" will be the string to flag the end of the filled portion of Events
for(i=0; i<MAX_ELEM; i++)
{
   Events[i] = new Array(3);
   Events[i][0] = "@";
   Events[i][1] = "@";
   Events[i][2] = "@";
}

/* Manually fill in the dates / events.  I wanted to read from a text file
 *   but Javascript would not allow me...
 *
 * To add a new event, add three lines.  Examples:
 *   Events[0][0] = '10/31/2001';
 *   Events[0][1] = '10/31/2001';
 *   Events[0][2] = 'Halloween';
 *
 *   Events[1][0] = '1/1/2002';
 *   Events[1][1] = '1/8/2002';
 *   Events[1][2] = 'Celebration for a week';
 *
 * Time the event will be displayed:  Starting on Events[n][0],
 *                                    Ending at the end of the day Events[n][1]
 *
 * The event name can also have HTML tags.
 * The order in which events are entered does not matter.  The events will be
 *   displayed on the page (if the date is in the valid range) in whatever
 *   order they are in in the array.
 */

Events[0][0]    = '6/1/2011';
Events[0][1]    = '6/1/2011';
Events[0][2]    = 'Congratulations Class of 2011<br><a href="alumni/2011/">Click Here to View the Graduation Slideshow</a>';
/*
Events[0][0]    = '12/16/2010';
Events[0][1]    = '12/17/2010';
Events[0][2]    = 'NHS Induction Ceremony/Reception<br>Rescheduled to 12/21, 7:00 p.m.';
*/
Events[0][0]    = '8/10/2011';
Events[0][1]    = '8/23/2011';
Events[0][2]    = '8/24 - <a href="orgs/classes/fresh/picnic.pdf">WJ New Student Family Cookout</a><br>6:00 p.m. WJ Back Fields!' +
                  '<br>8/25 - New Student Orientation, 7:25 a.m.<br><a href="information/bells/orientation.shtm">Bell ' +
                  'Schedule</a> | <a href="information/buses/">Bus Schedules</a><br>';
/*
Events[1][0]    = '8/24/2011';
Events[1][1]    = '8/25/2011';
Events[1][2]    = '8/25 - New Student Orientation, 7:25 a.m.<br><a href="information/bells/orientation.shtm">Bell ' +
                  'Schedule</a> | <a href="information/buses/">Bus Schedules</a><br>';
*/
/*
Events[1][0]    = '8/24/2011';
Events[1][1]    = '8/30/2011';
Events[1][2]    = 'Senior Shed Painting &amp; Picnic<br>Rescheduled to Wed, August 31st, 5:00 p.m.';
*/

Events[1][0]    = '11/1/2011';
Events[1][1]    = '11/23/2011';
Events[1][2]    = '<a href="#principal">Help WJ Win the YMCA Turkey Chase "Principal\'s Prize"<br>on Thanksgiving Day!</a>';

Events[2][0]    = '9/17/2011';
Events[2][1]    = '9/24/2011';
Events[2][2]    = '9/24 - Kensington 8k/2m/1k race to benefit WJ<br>' + 
                  '<a href="information/8k_application.pdf">Register by Mail</a> | <a href="http://www.kensington8k.org/">Register online</a>'; 
/*
Events[2][0]    = '11/10/2010';
Events[2][1]    = '11/13/2010';
Events[2][2]    = '<a href="http://wjstage.com/tickets" target="_blank">Buy your <i>The Importance of Being Earnest</i> tickets here!</a><br>';
                  '<font size="-1">Tickets will also be sold at lunch the week of 11/1.</font>'; 

Events[2][0]    = '11/25/2010';
Events[2][1]    = '11/28/2010';
Events[2][2]    = 'WJ Wins Turkey Chase Prize - Thank You To The WJ Community - Have A Relaxing Thanksgiving Break';
*/
Events[3][0]    = '11/17/2009';
Events[3][1]    = '12/3/2009';
Events[3][2]    = '12/5 - WJ Ed Foundation Gala to benefit WJ<br>' + 
                  '<a href="http://wjedfoundation.org/">Buy your tickets today!</a>'; 

//Events[2][0]    = '4/28/2009';
//Events[2][1]    = '5/15/2009';
//Events[2][2]    = '5/11-5/15 <a href="depts/ap/aps.shtm">AP Exams!</a>';

//Events[4][0]    = '4/19/2008';
//Events[4][1]    = '4/25/2008';
//Events[4][2]    = 'Seniors: A limited number of prom tickets are still available. See Ms. Baird in Portable 3 before ' +
//                  'school, during lunch, or after school. Tickets will be first-come, first-served until they are all sold';

//Events[6][0]    = '8/26/2008';
//Events[6][1]    = '10/1/2008';
//Events[6][2]    = 'Edline at WJ - <a href="information/edline">Click here for info</a><br>' +
                  'Parents, <a href="information/edline/activate.shtm">click here to activate your account</a><br>' +
                  'Students, <a href="information/edline/stu_activate.shtm">click here to activate your account</a>';

//Events[11][0]    = '3/9/2009';
//Events[11][1]    = '3/11/2009';
//Events[11][2]    = '<a href="orgs/booster/mulch_sale.pdf">Booster Club Mulch Sale Order Deadline 3/11</a>';

Events[12][0]    = '1/20/2012';
Events[12][1]    = '1/21/2012';
Events[12][2]    = '<a href="http://www.montgomeryschoolsmd.org/info/emergency/">MCPS Weather Announcements</a>';

Events[14][0]    = '10/6/2010';
Events[14][1]    = '10/18/2010';
Events[14][2]    = '<a href="orgs/classes/senior/graduation.shtm">Commencement 2011 is May 31st at 2:30 p.m.</a><br>';
//                   'classes canceled for undergraduates';

//Events[15][0]    = '5/13/2008';
//Events[15][1]    = '5/15/2008';
//Events[15][2]    = 'Fine Arts Festival - 5/14-15. Evening Reception 6-9 on 5/14';

Events[17][0]    = '1/25/2010';
Events[17][1]    = '2/8/2010';
Events[17][2]    = 'Class of 2011 - Register Now for the University of Maryland\'s Young Scholars Program!<br>' +
                   '<a href="umcp_scholars">Click here for more information</a>';

Events[15][0]    = '1/26/2011';
Events[15][1]    = '1/28/2011';
Events[15][2]    = 'Montgomery County Public Schools are closed on Friday, January 28 due to emergency weather conditions and power loss.<br>' +
                   'WJ\'s meeting about registration for 2011-2012 has been moved to the February 2nd snow date.<br>' +
                   '<a href="studserve/coursebook/reg_calendar.shtm">Click Here for Revised Registration Calendar</a><br>' +
                   '<font size="-1"><a href="http://www.montgomeryschoolsmd.org/info/emergency/">Click Here for Full MCPS Weather Announcements</a></font>' +
                   '<br><font size="-1">Ice Hockey game vs Churchill on 1/28 has been canceled<br><a href="athletics/reschedule.shtm">Click Here for Other Sports Reschedulings</a></font>';

Events[16][0]    = '2/23/2010';
Events[16][1]    = '2/26/2010';
Events[16][2]    = 'Seniors-<a href="orgs/classes/senior">Order the Class of 2010 Photo By This Friday!</a>';

Events[17][0]    = '6/14/2010';
Events[17][1]    = '6/30/2010';
Events[17][2]    = 'Newsweek, June 2010: Walter Johnson Ranks In The<br>Top 100 High Schools in the Nation<br>' +
 '<font size=-1>On Monday, June 14th, Newsweek published their annual rankings of the best public high schools in the nation. This year, WJ ranks #95. ' +
 'This impressive accomplishment speaks to the incredible dedication and hard work of our staff and students. Well done, WJ!</font>';

Events[18][0]    = '8/26/2011';
Events[18][1]    = '9/7/2011';
Events[18][2]    = 'Parents are Welcome at Back-To-School Night<br>on September 8th at 7:00 p.m.<br><font size="-1"><a href="information/btsn.shtm">Click here for information</a></font>';

Events[19][0]    = '10/8/2010';
Events[19][1]    = '10/8/2010';
Events[19][2]    = 'Today is the 1st Day of BonusBucks at Giant<br><font size="-1"><a href="information/fundraising/giant.html">PLEASE Register Your Card for WJ!</a></font>';

Events[20][0]    = '10/9/2010';
Events[20][1]    = '10/15/2010';
Events[20][2]    = 'Giant BonusBucks In Progress<br><font size="-1"><a href="information/fundraising/giant.html">PLEASE Register Your Card for WJ!</a></font>';

Events[21][0]    = '10/19/2010';
Events[21][1]    = '10/29/2010';
Events[21][2]    = '<a href="orgs/sga/homecoming.shtm">Homecoming Events at WJ 10/25-10/30!</a>';
/*
Events[22][0]    = '2/17/2011';
Events[22][1]    = '3/3/2011';
Events[22][2]    = '<a href="http://rtnwjhs.eventbrite.com/" Target="_blank">Click Here For Tickets To "RACE TO NOWHERE"</a><br>Sponsored by the WJ PTA CLUSTER<br>Enter walterj3311 in the pw box';
*/
Events[22][0]    = '2/17/2011';
Events[22][1]    = '2/23/2011';
Events[22][2]    = '"RACE TO NOWHERE" tickets are SOLD OUT';

Events[24][0]    = '1/6/2012';
Events[24][1]    = '1/19/2012';
Events[24][2]    = 'Parents are Welcome at Back-To-School Night<br>on February 2nd at 7:00 p.m.<br><font size="-1"><a href="information/btsn2.shtm">Click here for information</a></font>';
i = 0;

Events[25][0]    = '1/30/2011';
Events[25][1]    = '2/2/2011';
Events[25][2]    = 'Deadline for Student Parking Permit<br>Payment/Pick-up now February 3rd';

Events[26][0]    = '2/24/2011';
Events[26][1]    = '3/2/2011';
Events[26][2]    = '<a href="depts/ap/aps.shtm">AP Test Registration 2/28-3/2 &amp;--> 3/7-9</a>';

Events[27][0]    = '3/3/2011';
Events[27][1]    = '3/8/2011';
Events[27][2]    = '<a href="depts/ap/aps.shtm">March 7-9 Last Days of AP Test Registration</a>';

Events[28][0]    = '2/6/2012';
Events[28][1]    = '3/2/2012';
Events[28][2]    = '<a href="information/pennies_for_patients.shtm">Pennies for Patients In Progress Through 3/2</a>!';

Events[29][0]    = '2/8/2011';
Events[29][1]    = '2/11/2011';
Events[29][2]    = '<a href="information/dropoff.shtm">Important Drop-Off/Pick-Up Changes<br>Effective February 9th</a>!';


Events[30][0]    = '3/9/2011';
Events[30][1]    = '3/9/2011';
Events[30][2]    = '<a href="depts/ap/aps.shtm">TODAY Is The Last Day of AP REGULAR Registration</a><br>During lunch and after school until 3.<br>Late fees apply next Mon-Tue';

Events[31][0]    = '3/10/2011';
Events[31][1]    = '3/14/2011';
Events[31][2]    = '<a href="depts/ap/aps.shtm">March 14-15 AP Test LATE Registration</a><br>Absolutely NO AP Orders Will Be Accepted After March 15th';

Events[32][0]    = '3/29/2011';
Events[32][1]    = '4/3/2011';
Events[32][2]    = '<a href="depts/ap/aps.shtm">AP Preadministration Sessions</i> April 4th &amp; 6th!</a>'; 

Events[32][0]    = '4/29/2011';
Events[32][1]    = '5/12/2011';
Events[32][2]    = '<a href="depts/ap/aps.shtm">AP EXAM INFORMATION!</a>'; 

Events[33][0]    = '5/23/2011';
Events[33][1]    = '5/27/2011';
Events[33][2]    = '<a href="information/letters/baker_appt.pdf">New WJ Principal Announced</a>'; 

Events[34][0]    = '5/13/2011';
Events[34][1]    = '5/14/2011';
Events[34][2]    = 'Field Hockey Clinics Will Go On As Scheduled Unless There are Lightning Storms This Weekend'; 

Events[36][0]    = '10/24/2011';
Events[36][1]    = '11/15/2011';
Events[36][2]    = '<a href="information/letters/attendance_changes.pdf">October, 2011 - Important Attendance Information</a>!';

Events[37][0]    = '11/1/2011';
Events[37][1]    = '11/13/2011';
Events[37][2]    = '<a href="information/9th_private_schools_meeting.shtm">11/14 - Mtg for 9th grade private school families interested in attending WJ</a>';

Events[35][0]    = '11/21/2011';
Events[35][1]    = '12/2/2011';
Events[35][2]    = '<a href="information/holiday_gifts.shtm">WJ Holiday Gift-Giving Program</a><br>Help Child Victims of Neglect & Abuse';

// The locations of the slashes in the date
var AFSlash, ALSlash, BFSlash, BLSlash;

// Starting date / ending date strings -- used for comparison
var sdate = "", edate = ""; writestring = "";
var cdate, wrote1 = 0;

    /* The Netscape and IE versions of Date::getYear() return different values.
     *   Netscape returns the number of years since 1900, while IE returns
     *   the four number year.
     *
     * NOTE: I have not tested this code on other browsers, so I am assuming
     *   that every other browser in existence returns the four number year. ;)
     */
    if(navigator.appName.toLowerCase().indexOf("netscape") != -1)
       cdate = parseInt(now.getYear()+1900) + "-";
//    else if(navigator.appName.toLowerCase().indexOf("internet explorer") != -1)
//       cdate = parseInt(now.getYear()) + "-";
    else
       cdate = parseInt(now.getYear()) + "-";

    if((now.getMonth()+1) < 10)
      cdate += "0";
    cdate += (parseInt(now.getMonth()+1) + "-");

    if(now.getDate() < 10)
      cdate += "0";
    cdate += parseInt(now.getDate());

for(i=0; i<MAX_ELEM; i++)
{
if (Events[i][0] != "@")
{
  AFSlash = Events[i][0].indexOf("/");
  ALSlash = Events[i][0].lastIndexOf("/");
  BFSlash = Events[i][1].indexOf("/");
  BLSlash = Events[i][1].lastIndexOf("/");

  sdate = Events[i][0].substring(ALSlash+1,Events[i][0].length) + "-";

  if(parseInt(Events[i][0].substring(0,AFSlash)) < 10)
    sdate += "0";
  sdate += (Events[i][0].substring(0,AFSlash) + "-");

  if(parseInt(Events[i][0].substring(AFSlash+1,ALSlash)) < 10)
    sdate += "0";
  sdate += Events[i][0].substring(AFSlash+1,ALSlash);

  edate = Events[i][1].substring(BLSlash+1,Events[i][1].length) + "-";

  if(parseInt(Events[i][1].substring(0,BFSlash)) < 10)
    edate += "0";
  edate += (Events[i][1].substring(0,BFSlash) + "-");

  if(parseInt(Events[i][1].substring(BFSlash+1,BLSlash)) < 10)
    edate += "0";
  edate += Events[i][1].substring(BFSlash+1,BLSlash);

  if(sdate <= cdate && edate >= cdate)
  {
       if (wrote1 == 1) writestring = '<hr>';
       else writestring = '';
       writestring = writestring + '<span class="style9">' + Events[i][2] + '</span>'
       document.write(writestring);
       wrote1 = 1       /*indicate that we displayed a line so we can display <hr> between and <hr> at the end */
  }
// debugging
//  document.write(sdate + " " + cdate + " " + edate + "<br>");

}
}
if (wrote1 == 1) document.write('<hr>');  /* display the <hr> if we displayed something */
} // Time-check

// End hiding the Script-->

