<!-- // Hide the script

/*
 * eventcheck.js
 *
 * Checks the date and prints important events 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 unfilled items
for(i=0; i<MAX_ELEM; i++)
{
   Events[i] = new Array(5);
   Events[i][0] = "@";
   Events[i][1] = "@";
   Events[i][2] = "@";
   Events[i][3] = "@";
   Events[i][4] = "@";
}

/* 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 five lines.  Examples:
 *   Events[0][0] = '10/31/2001';
 *   Events[0][1] = '10/31/2001';
 *   Events[0][2] = 'headline';
 *   Events[0][3] = 'link';
 *   Events[0][4] = 'blurb';
 *
 * 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]    = '8/14/2008';
Events[0][1]    = '6/30/2009';
Events[0][2]    = 'Modernization - Early Spring Update';
Events[0][3]    = '/schools/wjhs/renovation/';
Events[0][4]    = 'Click the above link for a renovation update.<br>' +
//                '<a href="information/maps/interior.shtm">Click here for the new building maps</a><br>' +
                  '<a href="renovation/#pix">Click here for pictures</a>';
/*
Events[1][0]   = '2/22/2009';
Events[1][1]   = '3/15/2009';
Events[1][2]   = 'Handouts from "A Timeline to College Prep" meeting available online by clicking here';
Events[1][3]   = '/schools/wjhs/orgs/ptsa/guidance/handouts/';
Events[1][4]   = '';
*/
Events[1][0]   = '10/1/2009';
Events[1][1]   = '11/20/2009';
Events[1][2]   = 'APEX Scholars Application Period In Progress for the Class of 2014';
Events[1][3]   = '/schools/wjhs/depts/apex/application/';
Events[1][4]   = 'Click the above link for information and the required application forms.';

//Events[1][0]    = '12/5/2008';
//Events[1][1]    = '12/23/2008';
//Events[1][2]    = '12/23 - WJ Leadership Class hosts Activism Fair';
//Events[1][3]    = '/schools/wjhs/information/Activism_Fair_Form.rtf';
//Events[1][4]    = 'The WJ Leadership Class is hosting it\'s annual Activism Fair on December 23, 2008 from 7:30-2:30 in the WJ Cafeteria. ' +
//                   'The fair will have booths from groups across the political spectrum advocating their views and the ' +
//                   'common theme that students can be active in their causes and make a difference. ' +
//                   'Organizations interested in having a table please click the above link for a request form. Forms should be emailed by December 19th to Miles Lifson at ' +
//                   '<a href="javascript: email(\'miles.lifson\', \'gmail.com\');">miles.lifson@gmail.com</a> or to ' +
//                   '<a href="javascript: email(\'gabe.schwartzman\', \'gmail.com\');">gabe.schwartzman@gmail.com</a>'; 


Events[2][0]   = '10/7/2009';
Events[2][1]   = '10/13/2009';
Events[2][2]   = '10/13 - No Homework Assigned today to be due tomorrow';
Events[2][3]   = '';
Events[2][4]   = '';

Events[3][0]   = '9/1/2009';
Events[3][1]   = '10/15/2009';
Events[3][2]   = 'Order Sports Season Passes';
Events[3][3]   = '/schools/wjhs/orgs/booster/sports_pass_form.pdf';
Events[3][4]   = '';

//Events[3][0]   = '12/10/2007';
//Events[3][1]   = '1/4/2008';
//Events[3][2]   = 'Best Buddies Bowl-O-Rama, January 6, 2008. Register by 1/3/08. Team or individual registrations available.';
//Events[3][3]   = '/schools/wjhs/orgs/bestbuddies/bowl-o-rama.pdf';
//Events[3][4]   = '';

Events[4][0]   = '10/12/2009';
Events[4][1]   = '12/31/2009';
Events[4][2]   = 'Senior Parents: Order your child\'s graduation announcements and other accessories!';
Events[4][3]   = 'http://www.balfour.com/HS/Template.mvc/SchoolHomePage/32513';
Events[4][4]   = 'Information packets were distributed to seniors at the Senior Assembly on September 22nd.';

Events[5][0]   = '10/29/2009';
Events[5][1]   = '12/1/2009';
Events[5][2]   = 'Senior Parents: Order your child\'s yearbook ad by the Deadline - December 1st!';
Events[5][3]   = '/schools/wjhs/orgs/windup/buyingad.shtm';
Events[5][4]   = 'A Senior Ad is a great way to honor your graduate. Click the above link for pricing information ' +
                 'and instructions on how to order';
/*
Events[5][0]   = '11/30/2008';
Events[5][1]   = '12/27/2008';
Events[5][2]   = '12/27 - Rod Bower Memorial Ice Hockey Game, 7:00 p.m. - Rockville Ice Arena';
Events[5][3]   = '/schools/wjhs/orgs/hockey/Rod_Bower_Alumni_game.pdf';
Events[5][4]   = 'The Montgomery vs. WJ Alumni hockey game at Rockville Ice Arena is always lots of fun and the proceeds ' +
                 'go to the Rod Bower Learn Hockey Program at MYHA, which was established by the Bower family after ' + 
                 'Rod\'s death in 2004. Alumni interested in playing should email Barbara Inkellis at binkellis@cigcompanies.com';
*/
//Events[5][0]   = '10/27/2008';
//Events[5][1]   = '11/15/2008';
//Events[5][2]   = 'WJ S*T*A*G*E Presents <i>Brighton Beach Memoirs</i>, 8:00 p.m.<br>' +
                  'November 14-15 &amp; November 21-22 - WJ Auditorium<br>Click here to buy tickets!';
//Events[5][3]   = 'https://wjstage.ticketleap.com/brighton-beach-memoirs-11-14-2008-20-0/t/';
//Events[5][4]   = '';

//Events[5][0]   = '8/25/2008';
//Events[5][1]   = '9/15/2008';
//Events[5][2]   = 'Staff Changes at WJ';
//Events[5][3]   = '/schools/wjhs/information/staffchgs.shtm';
//Events[5][4]   = '';

Events[6][0]   = '10/12/2009';
Events[6][1]   = '11/7/2009';
Events[6][2]   = 'WJ Crew Citrus Sale Now In Progress';
Events[6][3]   = '/schools/wjhs/information/fundraising/crew_citrus_sale.pdf';
Events[6][4]   = 'Click the above link to order by the November 7th deadline.';
/*
Events[6][0]   = '8/15/2009';
Events[6][1]   = '9/4/2009';
Events[6][2]   = 'Seniors - Click here for parking permit information for Fall 2009';
Events[6][3]   = '/schools/wjhs/studserve/security/parking.shtm';
Events[6][4]   = 'Parking permit applications will be accepted from qualifying seniors from 9/1-4. Click the ' +
                 'above link for more information';
*/
Events[10][0]   = '11/1/2009';
Events[10][1]   = '11/17/2009';
Events[10][2]   = '<i>The Big Train</i> submission deadline is November 17th';
Events[10][3]   = '/schools/wjhs/orgs/ptsa/bigtrain/submit.html';
Events[10][4]    = 'Click the above link to submit an item.';

Events[16][0]   = '12/27/2009';
Events[16][1]   = '2/28/2010';
Events[16][2]   = 'Donations being accepted for Booster Club Used Book Sale through 2/28/10';
Events[16][3]   = '';
Events[16][4]   = 'Hardbacks and paperbacks for all reading levels are welcome. NEW THIS YEAR:  We will gratefully accept music CDs, audio books, DVDs, and VHS movies. Textbooks, ' + 
                  'manuals, encyclopedias, magazines, software, games and other media are not accepted. Your donations are tax ' +      
                  'deductible.<br>Deposit boxed donations outside the Main Office weekdays from 7:00 a.m. to 7:00 p.m. ' +
                  'Proceeds from the sale support all extracurricular activities at WJHS. Email questions to ' +
                  '<a href="javascript: email(\'booksale\', \'walterjohnson.com\');">booksale@walterjohnson.com</a>';

Events[41][0]    = '1/25/2009';
Events[41][1]    = '3/20/2009';
Events[41][2]    = '3/20 Booster Club Family Pasta Dinner &amp; SGA Benefit Basketball Game';
Events[41][3]    = '/schools/wjhs/orgs/booster/dinner.pdf';
Events[41][4]    = 'Bring your family, friends and neighbors to this annual evening of food and fun. Entertainment ' +
                   'provided by the WJ Music Department. Dinner at 5:30 p.m. and game at 7:00 p.m. Click the above link ' +
                   'for more information &amp; to reserve your spot';

Events[42][0]    = '1/25/2009';
Events[42][1]    = '3/20/2009';
Events[42][2]    = 'Booster Club Mulch Sale Now Accepting Orders through 3/20';
Events[42][3]    = '/schools/wjhs/orgs/booster/mulch_sale.pdf'
Events[42][4]    = 'Order by March 11th for home delivery March 28th Click the above link for the order form.';

Events[43][0]   = '3/7/2009';
Events[43][1]   = '3/21/2009';
Events[43][2]   = '3/20-21 - MSP Book Fair Fundraiser at Barnes &amp; Noble';
Events[43][3]   = '/schools/wjhs/msp/bookfair_coupon.pdf';
Events[43][4]   = 'Shop at Barnes &amp; Noble to benefit WJ\'s Minority Scholars Program. Festivities at the Rockville store but the WJ code can be used nationwide 3/20-21.' +
                   'Click the above link to print the required coupon. Keep one and give the other two to friends! ' +
                   '<a href="/schools/wjhs/msp/bookfair_events.pdf">Click here for a schedule of book fair events.</a>';
 
Events[50][0]   = '9/9/2009';
Events[50][1]   = '9/30/2009';
Events[50][2]   = 'Read the current <i>Big Train</i> Newsletter'; 
Events[50][3]   = '/schools/wjhs/orgs/ptsa/bigtrain';
Events[50][4]   = '';

Events[52][0]   = '2/17/2009';
Events[52][1]   = '3/2/2009';
Events[52][2]   = 'Read <i>The Pitch</i> Online';
Events[52][3]   = 'http://www.wjpitch.com';
Events[52][4]   = '';

Events[56][0]   = '12/5/2008';
Events[56][1]   = '12/11/2008';
Events[56][2]   = '12/11 - No Homework Assigned today to be due tomorrow';
Events[56][3]   = '';
Events[56][4]   = '';

Events[58][0]   = '1/7/2009';
Events[58][1]   = '1/13/2009';
Events[58][2]   = '1/13 - No Homework Assigned today to be due tomorrow';
Events[58][3]   = '';
Events[58][4]   = '';

Events[59][0]   = '3/3/2009';
Events[59][1]   = '3/9/2009';
Events[59][2]   = '3/9 - No Homework Assigned today to be due tomorrow';
Events[59][3]   = '';
Events[59][4]   = '';

Events[60][0]   = '3/2/2009';
Events[60][1]   = '4/30/2009';
Events[60][2]   = 'Field Hockey clinics and leagues for young players begin in March';
Events[60][3]   = '/schools/wjhs/athletics/fhockey/';
Events[60][4]   = 'Middle and elementary school girls interested in playing field hockey at WJ are encouraged to participate in these ' +
                  'leagues and clinics. Click the above link for more information.'; 

Events[70][0]   = '10/29/2009';
Events[70][1]   = '12/4/2009';
Events[70][2]   = 'Order your copy of the 2009-2010 Yearbook by 12/4/09!';
Events[70][3]   = '/schools/wjhs/orgs/windup/buying.shtm';
Events[70][4]   = '';

Events[80][0]   = '10/28/2009';
Events[80][1]   = '11/20/2009';
Events[80][2]   = 'National Honor Society Applications being accepted from eligible students through November 20th';
Events[80][3]   = '/schools/wjhs/orgs/nhs';
Events[80][4]   = 'Students meeting the GPA requirement were notified of their eligibility by letter and in a meeting on October 28th.';

i = 0;

// The locations of the slashes in the date
var AFSlash, ALSlash, BFSlash, BLSlash;

// Starting date / ending date strings -- used for comparison
var sdate = "", edate = "";
var cdate;

    /* 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());

//document.write('<h1>News Items...</h1>'); //write the category heading

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);

/* prepare the data to display

 * If it's within the date range...
 * If blurb is blank don't display a + sign
 * If link is non-blank, code it.
 * Display the headline
 * Display any non-blank blurb 
 */

  if(sdate <= cdate && edate >= cdate)
   { var headline = "<h3>";
if (Events[i][4] != "")
  headline = headline + '<img src="/gr/collapse-small.gif" border="0" onclick="javascript:tdisplay(700' + i + ')" id="700' 
  + i + 'plus" class="plusminus"><img src="/gr/expand-small.gif" border="0" onclick="javascript:tdisplay(700' + i + 
  ')" id="700' + i + 'minus" style="display:none" class="plusminus">';

 if (Events[i][3] != "")
  headline = headline + '<a href="' + Events[i][3] + '" target="_blank">';  

 headline = headline + Events[i][2];

 if (Events[i][3] != "")
 headline = headline + '</a>';

 headline = headline + '</h3>';

 document.write('<span class="specstyle">' + headline + '</span>');

 if (Events[i][4] != "")
      document.write('<p id="700' + i + '" style="display:none">' + Events[i][4] + '</p>');

// Display the data
//       document.write('<span class="specstyle">' +
//       Events[i][2] + '</span><br><br>');
// debugging
//  document.write(sdate + " " + cdate + " " + edate + "<br>");

} 
} 
}
} // date-check
document.write('<p></p>'); //blank line at the end


// End hiding the Script-->
