/*
 * seasonal_display.js
 *
 * Checks the dates and displays messages depending on whether it's school year or summer. 
 * The messages come from the calling file
 *
 */

var now = new Date();

// The locations of the slashes in the date
var AFSlash, ALSlash, BFSlash, BLSlash;

// Starting date / ending date strings -- used for comparison - dates after last day of school and before first day 
var sdate = "2010-06-19", edate = "2010-08-20";
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());
  if(sdate <= cdate && edate > cdate)
       document.write(summer_msg);

  else document.write(schoolyr_msg);
