// Event Calendar // copyright Stephen Chapman, 10th June 2006, 30th October 2006 var tb = 't'; // top or bottom (t or b) var headbg = '#cccccc'; // table heading background colour var todaybg = "" // current selected date background colour var textclr = '#607300'; // text colour var linkclr = '#00339B'; // link text colour var noMessage = ''; // message to display when no entry in array var dA = new Array(); var x = 0; dA[x++] = "201101002 no need to show this";dA[x++] = "201101106 no need to show this";dA[x++] = "201101112 no need to show this";dA[x++] = "201101120 no need to show this";dA[x++] = "201101204 no need to show this";dA[x++] = "201101218 no need to show this";dA[x++] = "20110320 no need to show this";dA[x++] = "20110905 no need to show this";dA[x++] = "20110912 no need to show this";dA[x++] = "20110912 no need to show this";dA[x++] = "201201002 no need to show this";dA[x++] = "20120108 no need to show this";dA[x++] = "20120113 no need to show this";dA[x++] = "20120115 no need to show this";dA[x++] = "20120119 no need to show this";dA[x++] = "20120123 no need to show this";dA[x++] = "201201231 no need to show this";dA[x++] = "20120126 no need to show this";dA[x++] = "20120128 no need to show this";dA[x++] = "20120130 no need to show this";dA[x++] = "20120202 no need to show this";dA[x++] = "20120205 no need to show this";dA[x++] = "20120206 no need to show this";dA[x++] = "20120207 no need to show this";dA[x++] = "20120207 no need to show this";dA[x++] = "20120207 no need to show this";dA[x++] = "20120207 no need to show this";dA[x++] = "20120209 no need to show this";dA[x++] = "20120210 no need to show this";dA[x++] = "20120211 no need to show this";dA[x++] = "20120212 no need to show this";dA[x++] = "20120212 no need to show this";dA[x++] = "20120213 no need to show this";dA[x++] = "20120216 no need to show this";dA[x++] = "20120216 no need to show this";dA[x++] = "20120217 no need to show this";dA[x++] = "20120218 no need to show this";dA[x++] = "20120218 no need to show this";dA[x++] = "20120219 no need to show this";dA[x++] = "20120219 no need to show this";dA[x++] = "20120219 no need to show this";dA[x++] = "20120219 no need to show this";dA[x++] = "20120220 no need to show this";dA[x++] = "20120220 no need to show this";dA[x++] = "20120220 no need to show this";dA[x++] = "20120220 no need to show this";dA[x++] = "20120221 no need to show this";dA[x++] = "20120223 no need to show this";dA[x++] = "20120225 no need to show this";dA[x++] = "20120227 no need to show this";dA[x++] = "20120304 no need to show this";dA[x++] = "20120306 no need to show this";dA[x++] = "20120311 no need to show this";dA[x++] = "20120312 no need to show this";dA[x++] = "20120314 no need to show this";dA[x++] = "20120316 no need to show this";dA[x++] = "20120316 no need to show this";dA[x++] = "20120316 no need to show this";dA[x++] = "20120317 no need to show this";dA[x++] = "20120323 no need to show this";dA[x++] = "20120324 no need to show this";dA[x++] = "20120330 no need to show this";dA[x++] = "20120331 no need to show this";dA[x++] = "20120331 no need to show this";dA[x++] = "20120413 no need to show this";dA[x++] = "20120415 no need to show this";dA[x++] = "20120428 no need to show this";dA[x++] = "20120520 no need to show this";dA[x++] = "20120617 no need to show this";dA[x++] = "20120714 no need to show this";dA[x++] = "20120827 no need to show this";dA[x++] = "20120902 no need to show this";dA[x++] = "20120903 no need to show this";dA[x++] = "20130103 no need to show this"; // 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/JANVIER','FEBRUARY/FEVRIER','MARCH/MARS','APRIL/AVRIL','MAY/MAI','JUNE/JUIN','JULY/JUILLET','AUGUST/AOUT','SEPTEMBER / SEPTEMBRE','OCTOBER/OCTOBRE','NOVEMBER / NOVEMBRE','DECEMBER / DECEMBRE']; 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 = ['S/D','M/L','T/M','W/M','T/J','F/V','S/S']; 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 = ''; var td_start = ''; var cal = '
'; for(dex=0; dex < 7; dex++) {cal += td_start + dow[dex] + '';} cal += '<\/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 += ''; weekday = 0;} if(selDate==year+getmmdd(month+1,dex)) cal += hilite_start +''+ dex + '<\/span><\/b><\/td>'; else cal += td_start + '' + 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 += '
' + moy[month] + ' ' + year + '<\/font><\/b><\/td><\/tr>
 
';} else {cal += '
';} cal += '
'; return cal; } function start() { var x = '
<\/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;font-size:1.2em;font-weight:bold;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)); var mdrlink = "http://www.autismontario.com/Client/aso/ao.nsf/eventcalendardateindex?OpenView&D=" + selDate; if (ct == '') ct = nextDate('0000' + getmmdd(monthVal+1,dayVal)); if (ct == '') ct = noMessage;window.location=mdrlink; 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 + ':
' +ct;}