// Event Calendar
// copyright Stephen Chapman, 10th June 2006, 30th October 2006

var tb = 't'; // top or bottom (t or b)
var headbg = '#EAEAEA';  // table heading background colour
var todaybg = '#cccccc'; // current selected date background colour
var textclr = '#000000'; // text colour
var linkclr = '#0166B4'; // link text colour


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++] = "20100108 jan_8.htm";
dA[x++] = "20100113 jan_13.htm";
dA[x++] = "20100114 jan_14.htm";
dA[x++] = "20100120 jan_20.htm";
dA[x++] = "20100121 jan_21.htm";
dA[x++] = "20100122 jan_22.htm";
dA[x++] = "20100123 jan_23.htm";
dA[x++] = "20100124 jan_24.htm";
dA[x++] = "20100128 jan_28.htm";
dA[x++] = "20100129 jan_29.htm";
dA[x++] = "20100130 jan_30.htm";
dA[x++] = "20100204 feb_4.htm";
dA[x++] = "20100205 feb_5.htm";
dA[x++] = "20100206 feb_6.htm";
dA[x++] = "20100208 feb_8.htm";
dA[x++] = "20100209 feb_9.htm";
dA[x++] = "20100210 feb_10.htm";
dA[x++] = "20100211 feb_11.htm";
dA[x++] = "20100212 feb_12.htm";
dA[x++] = "20100213 feb_13.htm";
dA[x++] = "20100214 feb_14.htm";
dA[x++] = "20100218 feb_18.htm";
dA[x++] = "20100223 feb_23.htm";
dA[x++] = "20100224 feb_24.htm";
dA[x++] = "20100225 feb_25.htm";
dA[x++] = "20100226 feb_26.htm";
dA[x++] = "20100228 feb_28.htm";
dA[x++] = "20100302 mar_2.htm";
dA[x++] = "20100304 mar_4.htm";
dA[x++] = "20100305 mar_5.htm";
dA[x++] = "20100306 mar_6.htm";
dA[x++] = "20100309 mar_9.htm";
dA[x++] = "20100310 mar_10.htm";
dA[x++] = "20100317 mar_17.htm";
dA[x++] = "20100321 mar_21.htm";

dA[x++] = "20100329 mar_29.htm";
dA[x++] = "20100415 apr_15.htm";
dA[x++] = "20100417 apr_17.htm";
dA[x++] = "20100418 apr_18.htm";

dA[x++] = "20100420 apr_20.htm";
dA[x++] = "20100421 apr_21.htm";
dA[x++] = "20100422 apr_22.htm";
dA[x++] = "20100428 apr_28.htm";
dA[x++] = "20100504 may_4.htm";
dA[x++] = "20100508 may_8.htm";
dA[x++] = "20100509 may_9.htm";
dA[x++] = "20100513 may_13.htm";
dA[x++] = "20100514 may_14.htm";
dA[x++] = "20100515 may_15.htm";

dA[x++] = "20100527 may_27.htm";
dA[x++] = "20100603 june_3.htm";
dA[x++] = "20100604 june_4.htm";
dA[x++] = "20100607 june_7.htm";
dA[x++] = "20100610 june_10.htm";
dA[x++] = "20100614 june_14.htm";
dA[x++] = "20100615 june_15.htm";
dA[x++] = "20100621 june_21.htm";
dA[x++] = "20100623 june_23.htm";
dA[x++] = "20100625 june_25.htm";
dA[x++] = "20100629 june_29.htm";
dA[x++] = "20100705 july_5.htm";
dA[x++] = "20100710 july_10.htm";
dA[x++] = "20100715 july_15.htm";
dA[x++] = "20100828 aug_28.htm";
dA[x++] = "20100830 aug_30.htm";
dA[x++] = "20100908 sep_8.htm";
dA[x++] = "20100912 sep_12.htm";
dA[x++] = "20100914 sep_14.htm";
dA[x++] = "20100918 sep_18.htm";
dA[x++] = "20100921 sep_21.htm";
dA[x++] = "20100923 sep_23.htm";
dA[x++] = "20100924 sep_24.htm";
dA[x++] = "20101005 oct_5.htm";
dA[x++] = "20101006 oct_6.htm";
dA[x++] = "20101020 oct_20.htm";
dA[x++] = "20101030 oct_30.htm";
dA[x++] = "20101108 nov_8.htm";
dA[x++] = "20110106 january_06.htm";
dA[x++] = "20110107 january_07.htm";
dA[x++] = "20110110january_10.htm";
dA[x++] = "20110111 january_11.htm";
dA[x++] = "20110112 january_12.htm";
dA[x++] = "20110113 january_13.htm";
dA[x++] = "20110114 january_14.htm";
dA[x++] = "20110115 january_15.htm";
dA[x++] = "20110116 january_16.htm";
dA[x++] = "20110119 january_19.htm";
dA[x++] = "20110120 january_20.htm";
dA[x++] = "20110121 january_21.htm";
dA[x++] = "20110122 january_22.htm";
dA[x++] = "20110124 january_24.htm";
dA[x++] = "20110125 january_25.htm";
dA[x++] = "20110127 january_27.htm";
dA[x++] = "20110128 january_28.htm";
dA[x++] = "20110129 january_29.htm";
dA[x++] = "20110202 february_02.htm";
dA[x++] = "20110203 february_03.htm";
dA[x++] = "20110205 february_05.htm";
dA[x++] = "20110208 february_08.htm";
dA[x++] = "20110209 february_09.htm";
dA[x++] = "20110210 february_10.htm";
dA[x++] = "20110211 february_11.htm";
dA[x++] = "20110212 february_12.htm";
dA[x++] = "20110214 february_14.htm";
dA[x++] = "20110215 february_15.htm";
dA[x++] = "20110217 february_17.htm";
dA[x++] = "20110218 february_18.htm";
dA[x++] = "20110220 february_20.htm";
dA[x++] = "20110222 february_22.htm";
dA[x++] = "20110223 february_23.htm";
dA[x++] = "20110224 february_24.htm";
dA[x++] = "20110226 february_16.htm";

dA[x++] = "20110309 march_9.htm";
dA[x++] = "20110312 march_12.htm";
dA[x++] = "20110313 march_13.htm";
dA[x++] = "20110315 march_15.htm";
dA[x++] = "20110316 march_16.htm";
dA[x++] = "20110317 march_17.htm";
dA[x++] = "20110318 march_18.htm";
dA[x++] = "20110319 march_19.htm";
dA[x++] = "20110323 march_23.htm";
dA[x++] = "20110324 march_24.htm";
dA[x++] = "20110325 march_25.htm";
dA[x++] = "20110406 april_6.htm";
dA[x++] = "20110413 april_13.htm";
dA[x++] = "20110414 april_14.htm";
dA[x++] = "20110420 april_20.htm";
dA[x++] = "20110427 april_27.htm";
dA[x++] = "20110428 april_28.htm";
dA[x++] = "20110502 may_2.htm";
dA[x++] = "20110505 may_5.htm";
dA[x++] = "20110507 may_7.htm";
dA[x++] = "20110516 may_16.htm";
dA[x++] = "20110521 may_21.htm";
dA[x++] = "20110523 may_23.htm";
dA[x++] = "20110524 may_24.htm";
dA[x++] = "20110526 may_26.htm";
dA[x++] = "20110602 june_2.htm";
dA[x++] = "20110603 june_3.htm";
dA[x++] = "20110609 june_9.htm";
dA[x++] = "20110630 june_30.htm";
dA[x++] = "20110828 august_28.htm";
dA[x++] = "20110906 september_06.htm";
dA[x++] = "20110911 september_11.htm";
dA[x++] = "20110920 september_20.htm";
dA[x++] = "20110928 september_28.htm";
dA[x++] = "20110929 september_29.htm";
dA[x++] = "20111004 october_4.htm";
dA[x++] = "20111006 october_6.htm";
dA[x++] = "20111010 october_10.htm";
dA[x++] = "20111011 october_11.htm";
dA[x++] = "20111012 october_12.htm";
dA[x++] = "20111013 october_13.htm";
dA[x++] = "20111015 october_15.htm";
dA[x++] = "20111017 october_17.htm";
dA[x++] = "20111019 october_19.htm";
dA[x++] = "20111020 october_20.htm";
dA[x++] = "20111021 october_21.htm";
dA[x++] = "20111026 october_26.htm";
dA[x++] = "20111027 october_27.htm";
dA[x++] = "20111029 october_29.htm";
dA[x++] = "20111030 october_30.htm";
dA[x++] = "20111101 november_1.htm";
dA[x++] = "20111102 november_2.htm";
dA[x++] = "20111103 november_3.htm";

dA[x++] = "20111107 november_7.htm";
dA[x++] = "20111111 november_11.htm";
dA[x++] = "20111112 november_12.htm";
dA[x++] = "20111113 november_13.htm";
dA[x++] = "20111114 november_14.htm";
dA[x++] = "20111116 november_16.htm";
dA[x++] = "20111119 november_19.htm";
dA[x++] = "20111118 november_18.htm";
dA[x++] = "20111122 november_22.htm";
dA[x++] = "20111124 november_24.htm";
dA[x++] = "20111125 november_25.htm";
dA[x++] = "20111126 november_26.htm";
dA[x++] = "20111129 november_29.htm";
dA[x++] = "20111201 december_1.htm";
dA[x++] = "20111202 december_2.htm";
dA[x++] = "20111205 december_5.htm";
dA[x++] = "20111207 december_7.htm";
dA[x++] = "20111208 december_8.htm";
dA[x++] = "20111210 december_10.htm";
dA[x++] = "20111211 december_11.htm";
dA[x++] = "20111215 december_15.htm";
dA[x++] = "20111216 december_16.htm";
dA[x++] = "20111227 december_27.htm";
dA[x++] = "20120106 jan6_12.html";
dA[x++] = "20120108 jan8_12.html";
dA[x++] = "20120110 jan10_12.htm";
dA[x++] = "20120111 jan11_12.html";
dA[x++] = "20120112 jan12_12.htm";
dA[x++] = "20120113 jan13_12.html";
dA[x++] = "20120114 jan14_12.html";
dA[x++] = "20120118 jan18_12.html";
dA[x++] = "20120119 jan19_12.html";
dA[x++] = "20120120 jan20_12.htm";
dA[x++] = "20120121 jan21_12.html";
dA[x++] = "20120125 jan25_12.html";
dA[x++] = "20120126 jan26_12.htm";
dA[x++] = "20120127 jan27_12.html";
dA[x++] = "20120128 jan28_12.html";
dA[x++] = "20120131 jan31_12.html";
dA[x++] = "20120202 feb02_12.htm";
dA[x++] = "20120203 feb03_12.html";
dA[x++] = "20120204 feb04_12.html";
dA[x++] = "20120207 feb07_12.html";
dA[x++] = "20120208 feb08_12.html";
dA[x++] = "20120209 feb09_12.html";
dA[x++] = "20120210 feb10_12.html";
dA[x++] = "20120214 feb14_12.html";
dA[x++] = "20120215 feb15_12.html";
dA[x++] = "20120216 feb16_12.html";
dA[x++] = "20120217 feb17_12.html";
dA[x++] = "20120221 feb21_12.html";
dA[x++] = "20120222 feb22_12.html";
dA[x++] = "20120223 feb23_12.html";
dA[x++] = "20120224 feb24_12.html";
dA[x++] = "20120225 feb25_12.html";
dA[x++] = "20120228 feb28_12.html";
dA[x++] = "20120229 feb29_12.html";
dA[x++] = "20120322 mar22_12.htm";


// dA[x++] = "20060610 New Event Calendar Started today";

// 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 < 2009 || yy > 2100)) {alert('year must be after 2009'); 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 #E9E9E9;height:150px;width:230px"><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>'; 'style="color:'+textclr+'"'} 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:0pt solid #cccccc;width:238px;height:1px"><\/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; window.location =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));}
