/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Shaun Bailey | http://www.sbwebdevelopment.co.uk */
// set up variables
var monthsArray = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var daysArray = new Array("Sun","Mon","Tues","Wed","Thurs","Fri","Sat");
var prevYears = 1;	// number of years before current date
var futureYears = 10;	// number of years after current date
var today = new Date();
var nowMonth = today.getMonth();
var nowYear = today.getFullYear();
var curMonth = nowMonth;
var curYear = nowYear;
var monthEvents;
today.setDate(1);	// set to first day of the month

var eventsArray = new Array();
// format: dd,mm,yyyy,"event","frequency (Annual/Monthly/Weekly)" - Delete frequency for once-time occurrences
eventsArray[0] = new newEvent(25,12,2006,"Christmas Day","Annual");
eventsArray[1] = new newEvent(12,5,2007,"Home and Gardens Tour (FHS)");
eventsArray[2] = new newEvent(1,1,2006,"First Day of Month","Monthly");
eventsArray[3] = new newEvent(2,1,2007,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[4] = new newEvent(6,2,2007,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[5] = new newEvent(6,3,2007,"");
eventsArray[6] = new newEvent(3,4,2007,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[7] = new newEvent(1,5,2007,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[8] = new newEvent(5,6,2007,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[9] = new newEvent(3,7,2007,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[10] = new newEvent(7,8,2007,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[11] = new newEvent(4,9,2007,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[12] = new newEvent(2,10,2007,"King St. Committee 7:30 pm -held at 4911 S. 31st St.")
;eventsArray[13] = new newEvent(6,11,2007,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[14] = new newEvent(4,12,2007,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[15] = new newEvent(3,1,2007,"Board of Directors Meeting 7 pm");
eventsArray[16] = new newEvent(7,2,2007,"Board of Directors Meeting 7 pm");
eventsArray[17] = new newEvent(7,3,2007,"Board of Directors Meeting 7 pm");
eventsArray[18] = new newEvent(4,4,2007,"Board of Directors Meeting 7 pm");
eventsArray[19] = new newEvent(2,5,2007,"Board of Directors Meeting 7 pm");
eventsArray[20] = new newEvent(6,6,2007,"Board of Directors Meeting 7 pm");
eventsArray[21] = new newEvent(11,7,2007,"Board of Directors Meeting 7 pm");
eventsArray[22] = new newEvent(1,8,2007,"Board of Directors Meeting 7 pm");
eventsArray[23] = new newEvent(5,9,2007,"Board of Directors Meeting 7 pm");
eventsArray[24] = new newEvent(3,10,2007,"Board of Directors Meeting 7 pm");
eventsArray[25] = new newEvent(7,11,2007,"Board of Directors Meeting 7 pm");
eventsArray[26] = new newEvent(5,12,2007,"Board of Directors Meeting 7 pm");
eventsArray[27] = new newEvent(4,1,2007," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[28] = new newEvent(1,2,2007," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[29] = new newEvent(1,3,2007," ");
eventsArray[30] = new newEvent(5,4,2007," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[31] = new newEvent(3,5,2007," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[32] = new newEvent(7,6,2007," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[33] = new newEvent(5,7,2007," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[34] = new newEvent(2,8,2007," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[35] = new newEvent(6,9,2007," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[36] = new newEvent(4,10,2007," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[37] = new newEvent(1,11,2007," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[38] = new newEvent(6,12,2007," Holiday Party 6:00 pm - 9:00 pm Fair Golds 11:30 am-2 pm");
eventsArray[39] = new newEvent(11,1,2007,"Activities Committee - 7 pm");
eventsArray[40] = new newEvent(8,2,2007,"Activities Committee - 7 pm");
eventsArray[41] = new newEvent(8,3,2007,"Activities Committee - 7 pm");
eventsArray[42] = new newEvent(12,4,2007,"Activities Committee - 7 pm Yard Debris Recycling ");
eventsArray[43] = new newEvent(10,5,2007,"Activities Committee - 7 pm");
eventsArray[44] = new newEvent(14,6,2007,"Activities Committee - 7 pm");
eventsArray[45] = new newEvent(12,7,2007,"Activities Committee - 7 pm");
eventsArray[46] = new newEvent(9,8,2007,"Activities Committee - 7 pm");
eventsArray[47] = new newEvent(13,9,2007,"Activities Committee - 7 pm");
eventsArray[48] = new newEvent(11,10,2007,"Activities Committee - 7 pm");
eventsArray[49] = new newEvent(8,11,2007,"Activities Committee - 7 pm");
eventsArray[50] = new newEvent(13,12,2007,"Activities Committee - 7 pm");
eventsArray[51] = new newEvent(10,1,2007,"Communications Committee - 7 pm");
eventsArray[52] = new newEvent(14,2,2007,"Communications Committee - 7 pm");
eventsArray[53] = new newEvent(14,3,2007,"Communications Committee - 7 pm");
eventsArray[54] = new newEvent(11,4,2007,"Communications Committee - 7 pm");
eventsArray[55] = new newEvent(9,5,2007,"Communications Committee - 7 pm");
eventsArray[56] = new newEvent(13,6,2007,"Communications Committee - 7 pm");
eventsArray[57] = new newEvent(11,7,2007,"Communications Committee - 7 pm");
eventsArray[58] = new newEvent(8,8,2007,"Communications Committee - 7 pm");
eventsArray[59] = new newEvent(12,9,2007,"Communications Committee - 7 pm");
eventsArray[60] = new newEvent(10,10,2007,"Communications Committee - 7 pm");
eventsArray[61] = new newEvent(13,11,2007,"Communications Committee - 7 pm");
eventsArray[62] = new newEvent(12,12,2007,"Communications Committee - 7 pm");
eventsArray[63] = new newEvent(21,1,2007,"Games Night 7 pm");
eventsArray[64] = new newEvent(25,2,2007,"Games Night 7 pm");
eventsArray[65] = new newEvent(18,3,2007,"");
eventsArray[66] = new newEvent(22,4,2007,"Games Night 7 pm");
eventsArray[67] = new newEvent(20,5,2007,"Mimosa Open 9 am - 1 pm Games Night 7 pm");
eventsArray[68] = new newEvent(17,6,2007,"Games Night 7 pm");
eventsArray[69] = new newEvent(15,7,2007,"Games Night 7 pm");
eventsArray[70] = new newEvent(26,8,2007,"Games Night 7 pm");
eventsArray[71] = new newEvent(23,9,2007,"Games Night 7 pm");
eventsArray[72] = new newEvent(21,10,2007,"Games Night 7 pm");
eventsArray[73] = new newEvent(18,11,2007,"Games Night 7 pm");
eventsArray[74] = new newEvent(16,12,2007,"Games Night 7 pm");
eventsArray[75] = new newEvent(8,1,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[76] = new newEvent(12,2,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[77] = new newEvent(12,3,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[78] = new newEvent(9,4,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[79] = new newEvent(7,5,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[80] = new newEvent(11,6,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[81] = new newEvent(9,7,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[82] = new newEvent(6,8,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[83] = new newEvent(10,9,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[84] = new newEvent(8,10,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[85] = new newEvent(12,11,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[86] = new newEvent(10,12,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[87] = new newEvent(16,1,2007,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[88] = new newEvent(20,2,2007,"Identity Theft Seminar - 7 pm");
eventsArray[89] = new newEvent(20,3,2007,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[90] = new newEvent(17,4,2007,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[91] = new newEvent(15,5,2007,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[92] = new newEvent(19,6,2007,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[93] = new newEvent(17,7,2007,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[94] = new newEvent(21,8,2007,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[95] = new newEvent(18,9,2007,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[96] = new newEvent(16,10,2007,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[97] = new newEvent(20,11,2007,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[98] = new newEvent(18,12,2007,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[99] = new newEvent(17,1,2007,"Technology Committee - 7 pm");
eventsArray[100] = new newEvent(21,2,2007,"Technology Committee - 7 pm");
eventsArray[101] = new newEvent(21,3,2007,"Technology Committee - 7 pm");
eventsArray[102] = new newEvent(18,4,2007,"Technology Committee - 7 pm");
eventsArray[103] = new newEvent(16,5,2007,"Technology Committee - 7 pm");
eventsArray[104] = new newEvent(20,6,2007,"Technology Committee - 7 pm");
eventsArray[105] = new newEvent(18,7,2007,"Technology Committee - 7 pm");
eventsArray[106] = new newEvent(15,8,2007,"Technology Committee - 7 pm");
eventsArray[107] = new newEvent(19,9,2007,"Technology Committee - 7 pm");
eventsArray[108] = new newEvent(17,10,2007,"Technology Committee - 7 pm");
eventsArray[109] = new newEvent(21,11,2007,"Technology Committee - 7 pm");
eventsArray[110] = new newEvent(19,12,2007,"Technology Committee - 7 pm");
eventsArray[111] = new newEvent(18,1,2007,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[112] = new newEvent(15,2,2007,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[113] = new newEvent(15,3,2007,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[114] = new newEvent(19,4,2007,"Variance Committee 7 pm Yard Debris Recycling Fair Golds 11:30 am-2 pm");
eventsArray[115] = new newEvent(17,5,2007,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[116] = new newEvent(21,6,2007,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[117] = new newEvent(19,7,2007,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[118] = new newEvent(16,8,2007,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[119] = new newEvent(20,9,2007,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[120] = new newEvent(18,10,2007,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[121] = new newEvent(15,11,2007,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[122] = new newEvent(20,12,2007,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[123] = new newEvent(23,1,2007,"Book Group 7:30 pm");
eventsArray[124] = new newEvent(27,2,2007,"Book Group 7:30 pm");
eventsArray[125] = new newEvent(27,3,2007,"Book Group 7:30 pm");
eventsArray[126] = new newEvent(24,4,2007,"Book Group 7:30 pm");
eventsArray[127] = new newEvent(22,5,2007,"Book Group 7:30 pm");
eventsArray[128] = new newEvent(26,6,2007,"Book Group 7:30 pm");
eventsArray[129] = new newEvent(24,7,2007,"Book Group 7:30 pm");
eventsArray[130] = new newEvent(28,8,2007,"Book Group 7:30 pm");
eventsArray[131] = new newEvent(25,9,2007,"Book Group 7:30 pm");
eventsArray[132] = new newEvent(23,10,2007,"Book Group 7:30 pm");
eventsArray[133] = new newEvent(27,11,2007,"Book Group 7:30 pm");
eventsArray[134] = new newEvent(27,12,2007,"Book Group is cancelled for December");
eventsArray[135] = new newEvent(9,1,2007,"FCA Meeting 7:30 pm");
eventsArray[136] = new newEvent(13,2,2007,"FCA Meeting 7:30 pm");
eventsArray[137] = new newEvent(13,3,2007,"FCA Meeting 7:30 pm");
eventsArray[138] = new newEvent(10,4,2007,"FCA Meeting 7:30 pm");
eventsArray[139] = new newEvent(8,5,2007,"FCA Meeting 7:30 pm");
eventsArray[140] = new newEvent(12,6,2007,"FCA Meeting 7:30 pm");
eventsArray[141] = new newEvent(10,7,2007,"FCA Meeting 7:30 pm");
eventsArray[142] = new newEvent(14,8,2007,"FCA Meeting 7:30 pm");
eventsArray[143] = new newEvent(11,9,2007,"FCA Meeting 7:30 pm");
eventsArray[144] = new newEvent(9,10,2007,"FCA Meeting 7:30 pm");
eventsArray[145] = new newEvent(14,11,2007,"FCA Meeting 7:30 pm");
eventsArray[146] = new newEvent(11,12,2007,"FCA Meeting 7:30 pm");
eventsArray[147] = new newEvent(25,1,2007,"Fairlington Historical Society 6:30 pm");
eventsArray[148] = new newEvent(22,2,2007,"Fairlington Historical Society 6:30 pm");
eventsArray[149] = new newEvent(22,3,2007,"Fairlington Historical Society 6:30 pm");
eventsArray[150] = new newEvent(26,4,2007,"Fairlington Historical Society 6:30 pm");
eventsArray[151] = new newEvent(24,5,2007,"Fairlington Historical Society 6:30 pm");
eventsArray[152] = new newEvent(28,6,2007,"Fairlington Historical Society 6:30 pm");
eventsArray[153] = new newEvent(26,7,2007,"Budget Forum 7:00 pm");
eventsArray[154] = new newEvent(23,8,2007,"Fairlington Historical Society 6:30 pm");
eventsArray[155] = new newEvent(27,9,2007,"Fairlington Historical Society 6:30 pm");
eventsArray[156] = new newEvent(25,10,2007,"Fairlington Historical Society 6:30 pm");
eventsArray[157] = new newEvent(27,12,2007,"Fairlington Historical Society 6:30 pm");
eventsArray[158] = new newEvent(5,4,2007," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[159] = new newEvent(7,4,2007,"Easter Egg Hunt 10-11:30 am");
eventsArray[160] = new newEvent(9,4,2007,"Buildings & Grounds Committee - 7 pm");
eventsArray[161] = new newEvent(10,4,2007,"FCA Meeting 7:30 pm");
eventsArray[162] = new newEvent(11,4,2007,"Communications Committee - 7 pm");
eventsArray[163] = new newEvent(12,4,2007,"Activities Committee - 7 pm Yard Debris Recycling ");
eventsArray[164] = new newEvent(13,4,2007,"Pet Happy Hour 6-9 pm -Community Center Parking Lot");
eventsArray[165] = new newEvent(16,4,2007,"Recycling Task Force 7:30 pm");
eventsArray[166] = new newEvent(17,4,2007,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[167] = new newEvent(18,4,2007,"Technology Committee - 7 pm");
eventsArray[168] = new newEvent(19,4,2007,"Variance Committee 7 pm Yard Debris Recycling Fair Golds 11:30 am-2 pm");
eventsArray[169] = new newEvent(20,4,2007,"Rain Date Pet Happy Hour 6-9 pm -Community Center Parking Lot");
eventsArray[170] = new newEvent(21,4,2007,"Spring Walk-Through 9 am");
eventsArray[171] = new newEvent(22,4,2007,"Games Night 7 pm");
eventsArray[172] = new newEvent(26,4,2007,"Fairlington Historical Society 6:30 pm");
eventsArray[173] = new newEvent(2,3,2007,"Voices of Fairlington 6:30 pm");
eventsArray[174] = new newEvent(19,3,2007,"Recycling Task Force7:30 pm");
eventsArray[175] = new newEvent(4,2,2007,"Super Bowl Party 6 pm");
eventsArray[176] = new newEvent(28,3,2007,"Annual Meeting 7:30 pm (Abingdon School)");
eventsArray[177] = new newEvent(19,2,2007,"Office Closed Trash WILL BE picked up. Also Recycling Task Force - 7:30 pm");
eventsArray[178] = new newEvent(5,5,2007,"Spring Yard Sale 8 am-1pm");
eventsArray[179] = new newEvent(6,5,2007,"(Rain Date) Spring Yard Sale 8 am-1pm");
eventsArray[180] = new newEvent(12,5,2007,"Fairlington Historical Society's 2007 Home and Garden Tour 11 am -3 pm");
eventsArray[181] = new newEvent(13,1,2007,"Tot Lot Grand Opening 11 am");
eventsArray[182] = new newEvent(15,1,2007,"Office Closed Trash WILL BE picked up. Recycling Task Force - 7:30 pm");
eventsArray[183] = new newEvent(26,1,2007,"Candidate filing deadline 5:30 pm");
eventsArray[184] = new newEvent(18,5,2007,"Tennis Party 7pm Main Courts");
eventsArray[185] = new newEvent(20,5,2007,"Tennis Mimosa Open 9-1 AM");
eventsArray[186] = new newEvent(9,6,2007,"Margarita Party 6-9 PM");
eventsArray[187] = new newEvent(17,8,2007,"Tennis Party");
eventsArray[188] = new newEvent(19,8,2007,"Kids Pool Party");
eventsArray[189] = new newEvent(8,9,2007,"Tennis US Open Party");
eventsArray[190] = new newEvent(21,9,2007,"Tennis Party");
eventsArray[191] = new newEvent(16,9,2007,"Doggie Dip");
eventsArray[192] = new newEvent(13,10,2007,"Fall Yard Sale 8:00am - 1:00 pm, Petting Zoo 3:00 - 5:00 pm");
eventsArray[193] = new newEvent(11,5,2007,"Fairlington Historical Society 6:30 pm");
eventsArray[194] = new newEvent(19,5,2007,"Pool 5 opens");
eventsArray[195] = new newEvent(21,5,2007,"Recycling Task Force 7:30 pm");
eventsArray[196] = new newEvent(23,5,2007,"Voices of Fairlington, Paul Ferguson 6:30 pm");
eventsArray[197] = new newEvent(28,5,2007,"Management office closed. Trash will be picked up.");
eventsArray[196] = new newEvent(4,6,2007,"Go Green Forum 7:00 pm");
eventsArray[197] = new newEvent(15,6,2007,"Tennis Party, 7:00 pm.");
eventsArray[198] = new newEvent(4,7,2007,"July 4th Parade, 9:45 am.");
eventsArray[199] = new newEvent(6,7,2007,"Voices of Fairlington 6:30 pm");
eventsArray[200] = new newEvent(7,7,2007,"Tennis Clinic, 10:00 am, Main Courts.");
eventsArray[201] = new newEvent(8,7,2007,"Breakfast at Wimbledon, 9:00 am., Kiddie Float Party 3:00 pm - 6:00 pm, pool 1");
eventsArray[202] = new newEvent(16,7,2007,"Go Green Committee 7:00 pm");
eventsArray[203] = new newEvent(20,7,2007,"Tennis Party, 7:00 pm Main courts.");
eventsArray[204] = new newEvent(22,7,2007,"Hallway Open House 3:00 - 5:00 pm, 4629 and 4623 31st Rd.");
eventsArray[205] = new newEvent(3,8,2007,"Voices of Fairlington, 6:30 pm");
eventsArray[206] = new newEvent(4,8,2007,"Tennis Clinic, 10:00 am, Main Courts.");
eventsArray[207] = new newEvent(20,8,2007,"Go Green Committee 7:00 pm");
eventsArray[208] = new newEvent(26,8,2007,"Kids Pool Party 2:00pm - 4:00pm pool 5");
eventsArray[209] = new newEvent(17,9,2007,"Go Green Committee 7:00 pm");
eventsArray[210] = new newEvent(15,10,2007,"Go Green Committee 7:00 pm");
eventsArray[211] = new newEvent(19,10,2007,"FHS, Fairlington Homecoming Celebration");
eventsArray[212] = new newEvent(31,10,2007,"Halloween Party 5 - 7 pm","Annual");
eventsArray[213] = new newEvent(14,10,2007,"Rain Date Fall Yard and Plant Sale -Community Center Parking Lot");
eventsArray[214] = new newEvent(5,11,2007,"Activities Committee - 7 pm");
eventsArray[215] = new newEvent(17,11,2007,"Health Fair 11 am - 2 pm");
eventsArray[216] = new newEvent(19,11,2007,"Go Green Committee 7:00 pm");
eventsArray[216] = new newEvent(22,11,2007,"Office Closed Trash WILL NOT BE picked up.");
eventsArray[217] = new newEvent(23,11,2007,"Office Closed Trash WILL BE picked up.");
eventsArray[218] = new newEvent(24,11,2007,"Office Closed Trash WILL BE picked up.");
eventsArray[219] = new newEvent(19,11,2007,"Go Green Committee 7:00 pm");
eventsArray[220] = new newEvent(31,12,2007,"Parking Decals Expire","Annual");
eventsArray[221] = new newEvent(5,2,2008,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[222] = new newEvent(4,3,2008,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[223] = new newEvent(1,4,2008,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[224] = new newEvent(6,5,2008,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[225] = new newEvent(3,6,2008,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[226] = new newEvent(1,7,2008,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[227] = new newEvent(5,8,2008,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[228] = new newEvent(2,9,2008,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[229] = new newEvent(7,10,2008,"King St. Committee 7:30 pm -held at 4911 S. 31st St.")
;eventsArray[230] = new newEvent(4,11,2008,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[231] = new newEvent(2,12,2008,"King St. Committee 7:30 pm -held at 4911 S. 31st St.");
eventsArray[232] = new newEvent(2,1,2008,"Board of Directors Meeting 7 pm");
eventsArray[233] = new newEvent(6,2,2008,"Board of Directors Meeting 7 pm");
eventsArray[234] = new newEvent(5,3,2008,"Board of Directors Meeting 7 pm");
eventsArray[235] = new newEvent(2,4,2008,"Board of Directors Meeting 7 pm");
eventsArray[236] = new newEvent(7,5,2008,"Board of Directors Meeting 7 pm");
eventsArray[237] = new newEvent(4,6,2008,"Board of Directors Meeting 7 pm");
eventsArray[238] = new newEvent(2,7,2008,"Board of Directors Meeting 7 pm");
eventsArray[239] = new newEvent(6,8,2008,"Board of Directors Meeting 7 pm");
eventsArray[240] = new newEvent(3,9,2008,"Board of Directors Meeting 7 pm");
eventsArray[241] = new newEvent(1,10,2008,"Board of Directors Meeting 7 pm");
eventsArray[242] = new newEvent(5,11,2008,"Board of Directors Meeting 7 pm");
eventsArray[243] = new newEvent(3,12,2008,"Board of Directors Meeting 7 pm");
eventsArray[244] = new newEvent(7,2,2008," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[245] = new newEvent(6,3,2008," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[246] = new newEvent(3,4,2008," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[247] = new newEvent(1,5,2008," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[248] = new newEvent(5,6,2008," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[249] = new newEvent(3,7,2008," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[250] = new newEvent(7,8,2008," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[251] = new newEvent(4,9,2008," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[252] = new newEvent(2,10,2008," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[253] = new newEvent(6,11,2008," Tennis Committee 7 pm Fair Golds 11:30 am-2 pm");
eventsArray[254] = new newEvent(4,12,2008," Holiday Party 6:00 pm - 9:00 pm Fair Golds 11:30 am-2 pm");
eventsArray[255] = new newEvent(10,1,2008,"Activities Committee - 7 pm");
eventsArray[256] = new newEvent(14,2,2008,"Activities Committee - 7 pm");
eventsArray[257] = new newEvent(13,3,2008,"Activities Committee - 7 pm");
eventsArray[258] = new newEvent(10,4,2008,"Activities Committee - 7 pm Yard Debris Recycling ");
eventsArray[259] = new newEvent(8,5,2008,"Activities Committee - 7 pm");
eventsArray[260] = new newEvent(12,6,2008,"Activities Committee - 7 pm");
eventsArray[261] = new newEvent(10,7,2008,"Activities Committee - 7 pm");
eventsArray[262] = new newEvent(14,8,2008,"Activities Committee - 7 pm");
eventsArray[263] = new newEvent(11,9,2008,"Activities Committee - 7 pm");
eventsArray[264] = new newEvent(9,10,2008,"Activities Committee - 7 pm");
eventsArray[265] = new newEvent(13,11,2008,"Activities Committee - 7 pm");
eventsArray[266] = new newEvent(11,12,2008,"Activities Committee - 7 pm");
eventsArray[267] = new newEvent(9,1,2008,"Communications Committee - 7 pm");
eventsArray[268] = new newEvent(13,2,2008,"Communications Committee - 7 pm");
eventsArray[269] = new newEvent(12,3,2008,"Communications Committee - 7 pm");
eventsArray[270] = new newEvent(9,4,2008,"Communications Committee - 7 pm");
eventsArray[271] = new newEvent(14,5,2008,"Communications Committee - 7 pm");
eventsArray[272] = new newEvent(11,6,2008,"Communications Committee - 7 pm");
eventsArray[273] = new newEvent(9,7,2008,"Communications Committee - 7 pm");
eventsArray[274] = new newEvent(13,8,2008,"Communications Committee - 7 pm");
eventsArray[275] = new newEvent(10,9,2008,"Communications Committee - 7 pm");
eventsArray[276] = new newEvent(8,10,2008,"Communications Committee - 7 pm");
eventsArray[277] = new newEvent(12,11,2008,"Communications Committee - 7 pm");
eventsArray[278] = new newEvent(10,12,2008,"Communications Committee - 7 pm");
eventsArray[279] = new newEvent(27,1,2008,"Games Night 7 pm");
eventsArray[280] = new newEvent(24,2,2008,"Games Night 7 pm");
eventsArray[281] = new newEvent(16,3,2008,"Games Night 7 pm");
eventsArray[282] = new newEvent(20,4,2008,"Games Night 7 pm");
eventsArray[283] = new newEvent(18,5,2008,"Mimosa Open 9 am - 1 pm Games Night 7 pm");
eventsArray[284] = new newEvent(15,6,2008,"Games Night 7 pm");
eventsArray[285] = new newEvent(20,7,2008,"Games Night 7 pm");
eventsArray[286] = new newEvent(17,8,2008,"Games Night 7 pm");
eventsArray[287] = new newEvent(21,9,2008,"Games Night 7 pm");
eventsArray[288] = new newEvent(19,10,2008,"Games Night 7 pm");
eventsArray[289] = new newEvent(16,11,2008,"Games Night 7 pm");
eventsArray[290] = new newEvent(21,12,2008,"Games Night 7 pm");
eventsArray[291] = new newEvent(7,1,2008,"Buildings & Grounds Committee - 7 pm");
eventsArray[292] = new newEvent(11,2,2008,"Buildings & Grounds Committee - 7 pm");
eventsArray[293] = new newEvent(10,3,2008,"Buildings & Grounds Committee - 7 pm");
eventsArray[294] = new newEvent(14,4,2008,"Buildings & Grounds Committee - 7 pm");
eventsArray[295] = new newEvent(12,5,2008,"Buildings & Grounds Committee - 7 pm");
eventsArray[296] = new newEvent(9,6,2008,"Buildings & Grounds Committee - 7 pm");
eventsArray[297] = new newEvent(14,7,2008,"Buildings & Grounds Committee - 7 pm");
eventsArray[298] = new newEvent(11,8,2008,"Buildings & Grounds Committee - 7 pm");
eventsArray[299] = new newEvent(8,9,2008,"Buildings & Grounds Committee - 7 pm");
eventsArray[300] = new newEvent(13,10,2008,"Buildings & Grounds Committee - 7 pm");
eventsArray[301] = new newEvent(10,11,2008,"Buildings & Grounds Committee - 7 pm");
eventsArray[302] = new newEvent(8,12,2008,"Buildings & Grounds Committee - 7 pm");
eventsArray[303] = new newEvent(15,1,2008,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[304] = new newEvent(19,2,2008,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[305] = new newEvent(18,3,2008,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[306] = new newEvent(15,4,2008,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[307] = new newEvent(20,5,2008,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[308] = new newEvent(17,6,2008,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[309] = new newEvent(15,7,2008,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[310] = new newEvent(19,8,2008,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[311] = new newEvent(16,9,2008,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[312] = new newEvent(21,10,2008,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[313] = new newEvent(18,11,2008,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[314] = new newEvent(16,12,2008,"Parking, Security & Traffic Committee - 7 pm");
eventsArray[315] = new newEvent(16,1,2008,"Technology Committee - 7 pm");
eventsArray[316] = new newEvent(20,2,2008,"Technology Committee - 7 pm");
eventsArray[317] = new newEvent(19,3,2008,"Technology Committee - 7 pm");
eventsArray[318] = new newEvent(16,4,2008,"Technology Committee - 7 pm");
eventsArray[319] = new newEvent(21,5,2008,"Technology Committee - 7 pm");
eventsArray[320] = new newEvent(18,6,2008,"Technology Committee - 7 pm");
eventsArray[321] = new newEvent(16,7,2008,"Technology Committee - 7 pm");
eventsArray[322] = new newEvent(20,8,2008,"Technology Committee - 7 pm");
eventsArray[323] = new newEvent(17,9,2008,"Technology Committee - 7 pm");
eventsArray[324] = new newEvent(15,10,2008,"Technology Committee - 7 pm");
eventsArray[325] = new newEvent(19,11,2008,"Technology Committee - 7 pm");
eventsArray[326] = new newEvent(17,12,2008,"Technology Committee - 7 pm");
eventsArray[327] = new newEvent(17,1,2008,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[328] = new newEvent(21,2,2008,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[329] = new newEvent(20,3,2008,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[330] = new newEvent(17,4,2008,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[331] = new newEvent(16,5,2008,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[332] = new newEvent(19,6,2008,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[333] = new newEvent(17,7,2008,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[334] = new newEvent(21,8,2008,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[335] = new newEvent(18,9,2008,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[336] = new newEvent(16,10,2008,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[337] = new newEvent(20,11,2008,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[338] = new newEvent(18,12,2008,"Variance Committee 7 pm - Fair Golds 11:30 am-2 pm");
eventsArray[339] = new newEvent(22,1,2008,"Book Group 7:30 pm");
eventsArray[340] = new newEvent(26,2,2008,"Book Group 7:30 pm");
eventsArray[341] = new newEvent(25,3,2008,"Book Group 7:30 pm");
eventsArray[342] = new newEvent(22,4,2008,"Book Group 7:30 pm");
eventsArray[343] = new newEvent(27,5,2008,"Book Group 7:30 pm");
eventsArray[344] = new newEvent(24,6,2008,"Book Group 7:30 pm");
eventsArray[345] = new newEvent(22,7,2008,"Book Group 7:30 pm");
eventsArray[346] = new newEvent(26,8,2008,"Book Group 7:30 pm");
eventsArray[347] = new newEvent(23,9,2008,"Book Group 7:30 pm");
eventsArray[348] = new newEvent(28,10,2008,"Book Group 7:30 pm");
eventsArray[349] = new newEvent(25,11,2008,"Book Group 7:30 pm");
eventsArray[350] = new newEvent(23,12,2008,"Book Group 7:30 pm");
eventsArray[351] = new newEvent(26,3,2008,"Annual Meeting 7:30 pm Abingdon School");
eventsArray[352] = new newEvent(22,3,2008,"Easter Egg Hunt");

// create event object
function newEvent(day, month, year, memo, occurrence) {
	this.day = day;
	this.month = month;
	this.year = year;
	this.memo = memo;
	this.occurrence = occurrence;
	this.createMonth = createMonth;
}

// creates calendar for the current month
function createMonth() {
	var startDay = today.getDay();	// first day of the month
	var monLength = monthLength();	// number of days in month
	var lastDay = startDay+monLength-1;	// last day of the month
	monthEvents = new Array();	// array to hold events for current month

	// search through events for current month
	for(i=0;i<eventsArray.length;i++) {
		if(eventsArray[i].month == (curMonth+1) && (eventsArray[i].year == curYear || eventsArray[i].occurrence == "Annual")) {
			monthEvents[monthEvents.length] = i;
		}
		else if(eventsArray[i].occurrence == "Monthly" || eventsArray[i].occurrence == "Weekly") {
			monthEvents[monthEvents.length] = i;
		}
	}

	var content = "<table class=\"calendar\" cellspacing=\"0\">\n";
	// create headers
	content += "<tr>\n<th><a class=\"button\" href=\"javascript:void(prev())\">Previous</a></th>\n";
	content += "<th colspan=\"5\">" + monthsArray[curMonth] + " " + curYear + "</th>\n";
	content += "<th><a class=\"button\" href=\"javascript:void(next())\">Next</a></th>\n</tr><tr>\n";
	for(i=0;i<7;i++) {
		content += "<th>" + daysArray[i] + "</th>\n";
	}
	content += "</tr>\n<tr>\n";

	// create main content of calendar
	for(i=0;i<42;i++) {
		var occ = "";
		var occContent = "";
		var curDay = i+1-startDay;
		// check day against months events
		for(j=0;j<monthEvents.length;j++) {
				var occDate = new Date();
				occDate.setDate(eventsArray[monthEvents[j]].day);
				occDate.setMonth(eventsArray[monthEvents[j]].month);
				occDate.setFullYear(eventsArray[monthEvents[j]].year);

				if(curDay == eventsArray[monthEvents[j]].day && eventsArray[monthEvents[j]].occurrence != "Weekly") {	// deal with day, monthly and annual events
					occ = " class=\"occassion\"";
					fullContent = eventsArray[monthEvents[j]].memo;
					if(eventsArray[monthEvents[j]].memo.length > 14) {
						occContent = fullContent.substr(0,13) + "...";
						break;
					}
					else {
						occContent = fullContent;
						break;
					}
				}
				else if(occDate.getDate() == (i%7) && eventsArray[monthEvents[j]].occurrence == "Weekly") {	// deal with weekly events
					occ = " class=\"occassion\"";
						fullContent = eventsArray[monthEvents[j]].memo;
					if(eventsArray[monthEvents[j]].memo.length > 14) {
						occContent = fullContent.substr(0,13) + "...";
						break;
					}
					else {
						occContent = fullContent;
						break;
					}
				}
		}
		if(i>lastDay && i==35) {	// do not show last row if not needed
			break;
		}
		if(i<startDay || i>lastDay) {	// show blank cells before and after month
			content += "<td class=\"blank\"> </td>\n";
		}
		else {
			if(!(i%7) || !((i+1)%7) ) {	// get days of the weekend
				if(!(i%7)&& i>0) {
					content += "</tr>\n<tr>\n";
				}
				content += "<td" + occ + "><span class=\"weekend\">"+curDay+"</span><br /><a href=\"javascript:void(alert('"+fullContent+"'));s\">"+occContent+"</a></td>\n";
			}
			else {
				content += "<td" + occ + ">"+curDay+"<br /><a href=\"javascript:void(alert('"+fullContent+"'));\">"+occContent+"</a></td>\n";
			}
		}
	}
	content += "</tr></table>\n";

	return content;
}

// get length of month
function monthLength() {
	monLength = 31;
	if(curMonth == 3 || curMonth == 5 || curMonth == 8 || curMonth == 10) monLength = 30;
	if(curMonth == 1) {
		if(curYear%4) {
			monLength = 28;
		}
		else {
			monLength = 29;
		}
	}
	return monLength;
}

function droplists() {
	content = "<form name=\"calNav\" method=\"post\" action=\"\">\n";
	content += "<select name=\"month\">\n";
	for(i=0;i<12;i++) {
		content += "<option value=\""+i +"\"";
		if(i == curMonth) {
			content += " selected=\"selected\"";
		}
		content += ">" + monthsArray[i] + "</option>\n";
	}
	content += "</select> <select name=\"year\">\n";
	for(i=(nowYear-prevYears);i<=(nowYear+futureYears);i++) {
		content += "<option value=\""+i +"\"";
		if(i == curYear) {
			content += " selected=\"selected\"";
		}
		content += ">" + i + "</option>\n";
	}
	content += "</select>\n<input type=\"button\" value=\"Go\" onclick=\"newMonth()\" />\n";
	content += "</form>\n";
	return content;
}

function newMonth() {
	var mon = document.calNav.month.selectedIndex;
	curMonth = parseInt(document.calNav.month.options[mon].value);
	var yr = document.calNav.year.selectedIndex;
	curYear = parseInt(document.calNav.year.options[yr].value);
	today.setMonth(curMonth);
	today.setFullYear(curYear);
	document.getElementById("showCal").innerHTML = droplists() + createMonth();
}

// goto previous month
function prev() {
	curMonth -= 1;
	if(curMonth<0) {
		curMonth=11;
		if(curYear>(nowYear-prevYears)) {
			curYear -= 1;
		}
	}
	today.setMonth(curMonth);
	today.setFullYear(curYear);
	document.getElementById("showCal").innerHTML = droplists() + createMonth();
}

// goto next month
function next() {
	curMonth += 1;
	if(curMonth>11) {
		curMonth=0;
		if(curYear<(nowYear+futureYears)) {
			curYear += 1;
		}
	}
	today.setMonth(curMonth);
	today.setFullYear(curYear);
	document.getElementById("showCal").innerHTML = droplists() + createMonth();
}

