var tb = 't'; // top or bottom (t or b)
var headbg = '#E8ECEB';  // table heading background colour - "white"
var todaybg = '#8CA69E'; // current selected date background colour - "gray"
var textclr = '#2F4542'; // text color - "dark green"
var linkclr = '#F70202'; // link text colour - "red"
var noMessage =  'No event messages to display for today'; // message to display when no entry in array

var dA = new Array(); var x = 0;
// first 8 characters in ccyymmdd format for single date events
// first 8 characters in 0000mmdd format for every year events
dA[x++] = "00000907 Labor Day";
dA[x++] = "00000908 Staff Conference";
dA[x++] = "00000909 First Day for Students";
dA[x++] = "00000917 Back to School Night";
dA[x++] = "00000928 Yom Kippur - No School";
dA[x++] = "00000929 7:00PM 11th and 12th grade parent meeting";

dA[x++] = "00001002 Predictives";
dA[x++] = "00001003 Staff Conference";
dA[x++] = "00001009 ITA's";
dA[x++] = "00001010 Columbus Day Schools Closed";
dA[x++] = "00001012 PSATs";
dA[x++] = "00001014 Progress Reports Due";
dA[x++] = "00001017 Staff Conference";
dA[x++] = "00001031 Halloween, Seventh Grade Farm Trip";

dA[x++] = "00001107 Staff Conference, Ninth Grade Trip";
dA[x++] = "00001108 Grades Due, Staff Conference Day";
dA[x++] = "00001111 Veterns Day Schools Closed";
dA[x++] = "00001116 Evening P/T Conferences";
dA[x++] = "00001117 Afternoon P/T Conferences";
dA[x++] = "00001119 CVSR Retreat";
dA[x++] = "00001121 Staff Conference";
dA[x++] = "00001124 Thanksgiving: No School";
dA[x++] = "00001125 Thanksgiving: No School";

dA[x++] = "00001205 Staff Conference";
dA[x++] = "00001209 Progress Reports Due";
dA[x++] = "00001219 Staff Conference";
dA[x++] = "00001224 Winter Recess";
dA[x++] = "00001225 Winter Recess";
dA[x++] = "00001226 Winter Recess";
dA[x++] = "00001227 Winter Recess";
dA[x++] = "00001228 Winter Recess";
dA[x++] = "00001229 Winter Recess";
dA[x++] = "00001230 Winter Recess";
dA[x++] = "00001231 Winter Recess";

dA[x++] = "00000101 Winter Recess";
dA[x++] = "00000103 School Resumes";
dA[x++] = "00000109 Staff Conference";
dA[x++] = "00000116 Dr. Martin Luther King Jr. Day - No School";
dA[x++] = "00000118 Gallery Night";
dA[x++] = "00000120 Marking period ends";
dA[x++] = "00000123 Staff Conference";
dA[x++] = "00000124 Grades Due, Regents";
dA[x++] = "00000125 Regents";
dA[x++] = "00000126 Regents";
dA[x++] = "00000127 Regents";
dA[x++] = "00000131 Report Cards Distributed";


dA[x++] = "00000206 Quality Review";
dA[x++] = "00000207 Quality Review";
dA[x++] = "00000210 Winter Retreat";
dA[x++] = "00000211 Winter Retreat";
dA[x++] = "00000212 Winter Retreat";
dA[x++] = "00000220 Mid-Winter Recess";
dA[x++] = "00000221 Mid-Winter Recess";
dA[x++] = "00000222 Mid-Winter Recess";
dA[x++] = "00000223 Mid-Winter Recess";
dA[x++] = "00000224 Mid-Winter Recess";
dA[x++] = "00000226 Afternoon P/T Conferences";
dA[x++] = "00000206 Evening P/T Conferences";

dA[x++] = "00000301 Staff Conference";
dA[x++] = "00000315 Staff Conference";
dA[x++] = "00000318 Parent Teacher Evening-Report Cards Distibuted";
dA[x++] = "00000319 End of marking period: Semester II: Term I - Parent Teacher Afternoon";
dA[x++] = "00000322 All Grades Due";
dA[x++] = "00000326 Report Cards Distributed";
dA[x++] = "00000329 Spring Recess";
dA[x++] = "00000330 Spring Recess";
dA[x++] = "00000331 Spring Recess";

dA[x++] = "00000401 Spring Recess";
dA[x++] = "00000402 Spring Recess";
dA[x++] = "00000405 Spring Recess";
dA[x++] = "00000406 Spring Recess";
dA[x++] = "00000412 Staff Conference";
dA[x++] = "00000419 Potential Failure Notices due by the end of the day";
dA[x++] = "00000426 NYS ELA Exam - Grades 6-8";
dA[x++] = "00000427 NYS ELA Exam - Grades 6-8";
dA[x++] = "00000428 NYS ELA Exam - Grades 6-8";

dA[x++] = "00000503 Staff Conference";
dA[x++] = "00000505 NYS Math Exam - Grades 6-8";
dA[x++] = "00000506 NYS Math Exam - Grades 6-8, English Lit. AP";
dA[x++] = "00000507 End of Marking Period Semester II: Term II - NYS Math Exam - Grades 6-8, US History AP";
dA[x++] = "00000510 All Grades Due";
dA[x++] = "00000514 Report Cards Distributed";
dA[x++] = "00000517 Staff Conference";
dA[x++] = "00000528 Potential Failure Notices due by the end of the day";
dA[x++] = "00000531 Memorial Day - No School";

dA[x++] = "00000607 Grade 8 NYS Science Exam (written)";
dA[x++] = "00000608 Half Day for middle school";
dA[x++] = "00000609 Gallery Night";
dA[x++] = "00000610 Conference Day";
dA[x++] = "00000614 NYS Social Studies Test (Grade 8)";
dA[x++] = "00000615 NYS Social Studies Test (Grade 8) - Regents";
dA[x++] = "00000616 Regents";
dA[x++] = "00000617 Half Day For Middle School Students - Regents";
dA[x++] = "00000618 End of Marking Period Semester II: Term III - Regents";
dA[x++] = "00000621 All Grades Due - Regents";
dA[x++] = "00000622 Regents";
dA[x++] = "00000623 Regents";
dA[x++] = "00000624 Regents";
dA[x++] = "00000628 Last day for Students and Teachers";


// permission is granted to use this javascript provided that the below code is not altered
var pageLoaded = 0; window.onload = function() {pageLoaded = 1;}
function loaded(i,f) {if (document.getElementById && document.getElementById(i) != null) f(); else if (!pageLoaded) setTimeout('loaded(\''+i+'\','+f+')',100);
}
function monthlength(month,year) {var dd = new Date(year, month, 0);return dd.getDate();}
var moy = ['January','February','March','April','May','June','July','August','September','October','November','December'];var today = new Date();var selDate = today.getFullYear()+getmmdd(today.getMonth()+1,today.getDate());
function dispCal(yy,mm) {if (mm < 0 || mm > 12) {alert('month must be between 1 and 12'); return false;} if (yy != 0 && (yy < 1901 || yy > 2100)) {alert('year must be after 1900 and before 2101'); return false;} var dow = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']; var calendar = new Date();  var today = calendar.getDate(); calendar.setDate(1); if (yy > 1900) calendar.setFullYear(yy); if (mm > 0) calendar.setMonth(mm - 1); var yy = year = calendar.getFullYear(); var month = calendar.getMonth(); calendar.setDate(today); var weekday = calendar.getDay(); var daysInMonth = monthlength(month+1,year); 

var hilite_start = '<td width="30" style="background:' + todaybg + '" align="center"><b>'; var td_start = '<td width="30" align="center">'; var cal = '<div id="cal"><div style="border:1pt solid #cccccc;height:200px;width:238px"><table border="0" cellspacing="0" cellpadding="2" align="center"><tr><td colspan="7" style="background:' + headbg + '" align="center"><b>' + moy[month]  + ' ' + year + '<\/b><\/td><\/tr><tr>'; 

for(dex=0; dex < 7; dex++) {cal += td_start + dow[dex] + '</td>';} cal += '<\/tr><tr>'; var day2 = today; for (dex = today; dex > 6; dex -=7) day2 = dex; weekday -= day2 - 1; while (weekday < 0) weekday += 7; for(dex=0; dex < weekday; dex++) cal += td_start + ' <\/td>'; for(dex=1; dex <= daysInMonth; dex++) {if(weekday == 7) {cal += '</tr><tr>'; weekday = 0;} if(selDate==year+getmmdd(month+1,dex)) cal += hilite_start +'<span'+clickDate(dex,month,year) + '>'+ dex + '<\/span><\/b><\/td>'; else cal += td_start + '<span '+clickDate(dex,month,year) + '>' + dex + '<\/span><\/td>'; weekday += 1;} for(dex=weekday; dex < 7; dex++) cal += td_start + ' <\/td>'; cal += '<\/tr><\/table><\/div>';if (document.getElementById) {var mmb = month;  mm = month + 1; var yya = yyb = yy; if (mmb <1) {mmb += 12; yyb--;} var mma = month + 2; if (mma > 12) {mma -= 12; yya++;} var yb = yy -1; var ya = yy +1; cal += '<table border="0" cellspacing="0" cellpadding="2" width="210"><tr><td><a href="#" onclick="if (cala = dispCal('+yb+','+mm+')) {document.getElementById(\'cal\').innerHTML = cala; return false;}"><<</a></td><td><a href="#" onclick="if (cala = dispCal('+yyb+','+mmb+')) {document.getElementById(\'cal\').innerHTML = cala; return false;}"><</a></td><td align="right"><a href="#" onclick="if (cala = dispCal('+yya+','+mma+')) {document.getElementById(\'cal\').innerHTML = cala; return false;}">></a></td><td align="right"><a href="#" onclick="if (cala = dispCal('+ya+','+mm+')) {document.getElementById(\'cal\').innerHTML = cala; return false;}">>></a></td></tr></table>';} else {cal += '<div> </div>';} cal += '</div>'; return cal;}
function start() {var x = '<div id="calDate" style="border:1pt solid #cccccc;width:238px"><\/div>'; var y = ''; if (tb == 't') y = x + dispCal(0,0); else y = dispCal(0,0) + x; document.getElementById('calendar').innerHTML = y; ev();}
loaded('calendar',start);
function clickDate(day, month, year) {var ct = nextDate(year + getmmdd(month+1,day));if (ct == '') ct = nextDate('0000' + getmmdd(month+1,day));if (ct == '') return 'style="color:'+textclr+'"'; else return 'style="cursor:pointer;color:'+linkclr+'" onclick="selDate = '+year+ getmmdd(month+1,day)+'; isDate(' + day + ',' + month + ',' + year + ');return false;"';}function isDate(dayVal,monthVal,yearVal) {var ct = nextDate(yearVal + getmmdd(monthVal+1,dayVal));if (ct == '') ct = nextDate('0000' + getmmdd(monthVal+1,dayVal));if (ct == '') ct = noMessage;document.getElementById('calDate').innerHTML = selDate + ':<br \/>' +ct; return false;}function nextDate(yymmdd) {var x = dA.length;for (var i = 0; i < x; i++) {if (dA[i].substr(0,8) == yymmdd) return dA[i].substr(8);}return '';}function getmmdd(mm,dd) {return (mm > 9 ? '' + mm : '0' + mm) + (dd > 9 ? dd : '0' + dd);}
function ev() {var ct = nextDate(selDate);var ct = nextDate(selDate);if (ct == '') ct = nextDate('0000' + selDate.substr(4));if (ct == '') ct = noMessage; document.getElementById('calDate').innerHTML = selDate + ':<br \/> ' +ct;}
