function buildCal(m, y, cM, cH, cDW, cD, brdr)
{
	var mn=['January','February','March','April','May','June','July','August','September','October','November','December'];
	var dim=[31,0,31,30,31,30,31,31,30,31,30,31];
	
	var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st
	oD.od=oD.getDay()+1;
	
	var events = new Array();
	events[0] = new Array
	(
		"3",
		"21",
		"2009",
		"CLIMB FOR YOUTH Fundraiser",
		"cfy/",
		"Teams and individuals are invited to compete to climb the most vertical feet and raise the most money to support their programming at The Adventure Centre. No prior climbing or belay experience is needed!"
	);
	events[1] = new Array
	(
		"3",
		"25",
		"2009",
		"Noodles &amp; Company Fundraiser",
		"",
		"Invite your friends and join us for dinner. Noodles &amp; Company will donate 25% of sales to The Adventure Centre."
	);
	events[2] = new Array
	(	
		"4",
		"10",
		"2009",
		"Full Moon Ropes Course",
		"",
		"The challenge of a high ropes course under the moon. For individuals\, couples\, small groups of friends seeking a high adventure way to spend an evening."
	);
	events[3] = new Array
	(	
		"4",
		"13-15",
		"2009",
		"Home Schooling Program (12-14 yr. olds)",
		"",
		"With a focus on personal challenge and group development this program is open to home schooled youth."
	);
	events[4] = new Array
	(	
		"4",
		"27-29",
		"2009",
		"Home Schooling Program (16-18 yr. olds)",
		"",
		"With a focus on personal challenge and group development this program is open to home schooled youth."
	);
	events[5] = new Array
	(	
		"5",
		"01-03",
		"2009",
		"Couples Retreat Weekend",
		"",
		"A cooperative workshop to help couples explore\, challenge\, and encourage themselves to fully experiencing their relationship with each other."
	);
	events[6] = new Array
	(	
		"5",
		"29-31",
		"2009",
		"Personal Exploration Workshop",
		"educational.php#personal",
		"The PEW is an opportunity to gain insight into your personal style of relating with others\, to reflect on personal growth\, identify strengths and challenge yourself."
	);
	events[7] = new Array
	(	
		"6",
		"05",
		"2009",
		"Full Moon Ropes Course",
		"",
		"The challenge of a high ropes course under the moon. For individuals\, couples\, small groups of friends seeking a high adventure way to spend an evening."
	);
	events[8] = new Array
	(	
		"6",
		"08-10",
		"2009",
		"Ropes Towers and Walls (12-14 yr. olds)",
		"",
		"What is leadership? How can I effectively &quot;lead myself&quot;? What are the skills needed to lead others? This program will explore the themes of personal and group leadership using challenge and adventure."
	);
	events[9] = new Array
	(	
		"6",
		"12-14",
		"2009",
		"Power of Solitude",
		"",
		"This program has two pre-sessions with activities and other preparations for a weekend of solo camping. This experience is supported (meals\, camping support\, and some facilitation)\, and will offer opportunities for personal challenge and growth."
	);
	events[10] = new Array
	(	
		"6",
		"15-17",
		"2009",
		"Ropes Towers and Walls (15-17 yr. olds)",
		"",
		"What is leadership? How can I effectively &quot;lead myself&quot;? What are the skills needed to lead others? This program will explore the themes of personal and group leadership using challenge and adventure."
	);
	events[11] = new Array
	(	
		"7",
		"07",
		"2009",
		"Full Moon Ropes Course",
		"",
		"The challenge of a high ropes course under the moon. For individuals\, couples\, small groups of friends seeking a high adventure way to spend an evening."
	);
	events[12] = new Array
	(	
		"8",
		"04 &amp 05",
		"2009",
		"Adventure Education for the Classroom",
		"",
		"Learn the basics of adventure education facilitation\, some activities\, and create a lesson plan to utilizing those activities."
	);
	events[13] = new Array
	(	
		"8",
		"06",
		"2009",
		"Teacher Reinvigoration",
		"",
		"Reinvigorate your practice working with other inspired and committed teaching professionals. Take a personal challenge\, solidify personal goals and reflect on your classroom practice in a cooperative and supportive environment."
	);
	events[14] = new Array
	(	
		"9",
		"04",
		"2009",
		"Full Moon Ropes Course",
		"",
		"The challenge of a high ropes course under the moon. For individuals\, couples\, small groups of friends seeking a high adventure way to spend an evening."
	);

	var dates = new Array();
	var u = new String();
	
	var scanfordates = new Array();

	for(i=0;events[i];i++)
	{
		dates[i]=new Date();
		dates[i].setMonth(events[i][0]);
		dates[i].setDate(events[i][1].charAt(0)+events[i][1].charAt(1));
		dates[i].setFullYear(events[i][2]);
		scanfordates[i]=(y==dates[i].getFullYear() && m==dates[i].getMonth())? dates[i].getDate() : 0
	}
	
	dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
	var t='<div class="'+cM+'"><table class="'+cM+'" cols="7" cellpadding="0" border="'+brdr+'" cellspacing="0"><tr align="center">';
	t+='<td colspan="7" align="center" class="'+cH+'">'+mn[m-1]+' - '+y+'</td></tr><tr align="center">';
	for(s=0;s<7;s++)t+='<td class="'+cDW+'">'+"SMTWTFS".substr(s,1)+'</td>';
	t+='</tr><tr align="center">';
	for(i=1;i<=42;i++){
		var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))? i-oD.od+1 : '&nbsp;';
		
		for(j=0;j<scanfordates.length;j++)
		{
			if (x==scanfordates[j])
			{
				x='<span style="color:red;font-weight:bold">'+x+'</span>'
				u+='<p class=\"small\"><span class=\"bold-green\">'+mn[events[j][0]-1]+' '+events[j][1]+'</span><br><a href="'+events[j][4]+'">'+events[j][3]+'</a><br><span style="font-size:0.9em">'+events[j][5]+'</span></p>';
			}
		}
		
		t+='<td class="'+cD+'">'+x+'</td>';
		if(((i)%7==0)&&(i<36))t+='</tr><tr align="center">';
	}
	return t+='</tr></table></div>'+u;
}

