recordsToDiplay = 2;
CalEvent = [
	['September 28, 2009', 'Monday, Septmeber 28th, 3:00-5:00pm, Hinde Auditorium, UU', 'Responsibility and Resistance', 'Dr. Stephen Bloch-Schulman'],
	['October 21, 2009', 'Wednesday, October 21st, 3:00-5:00pm, Hinde Auditorium, UU', 'Building Better Beings: Responsibility in a World of Causes', 'Dr. Mauel Vargas'],
	['October 26, 2009', 'Monday, October 26th, 9:00-5:00pm, Hinde Auditorium, UU', 'After Proposition 8', 'College of Arts & Letters Symposium'],
	['November 4, 2009', 'Wednesday, November 4th, 5:30-7:30pm, Mendocino Hall 1003', 'The Xaripu Community Across Borders', 'Serna Center Event'],
	['November 9, 2009', 'Monday, November 9th, 8:30-5:00pm, Hinde Auditorium, UU', 'The Ethics of Food', 'Annual Fall Ethics Symposium'],
	['December 2, 2009', 'Wednesday, December 2nd, 12:00-1:30pm, Delta Suite, UU', 'Whats God Got to Do with It? A Debate on the Prospects of Ethics without Religion ', 'Russell DiSilvestro & Jeremy Garrett'],
	['April 5, 2010', 'Monday, April 5th, 5:00pm', 'Submission Deadline', 'Students Ethics Essay Competition'],
	['April 7, 2009', 'Tuesday, April 7th, 10:00-12:00pm, Hinde Auditorium, UU', 'Bioethics: Creating a Disposable Caste of People?', 'Wesley J. Smith'],
	['May 6, 2009', 'Wednesday, May 6th, 9:00-12:00pm, Foothill Suite, UU', 'Personal and Professional Integrity', 'RCA 2nd Annual Closing Plenary']
];


var i = 0;
var j = 0;
var today = new Date();
var myDate;

while(i < CalEvent.length) {

	if(j >= recordsToDiplay) { break; }

	myDate = new Date(CalEvent[i][0]);
	
	// add one day (for display on the day of the event)
	myDate.setDate(myDate.getDate() + 1);
	
	if(myDate > today) {
		
		document.writeln("<li class=\"calendarStyle\">");
		document.writeln("<div class=\"calendarDate\">" + CalEvent[i][1] + "</div>");
		document.writeln("<a href=\"campus_events.htm#" + [i+1] + "\">");
		document.writeln("<div class=\"calendarInfo\">" + "<i>" +CalEvent[i][2] + "</i>" + "</div>");
		document.writeln("<div class=\"calendarInfo\">" + CalEvent[i][3] + "</div>");
		document.writeln("</a>");
		document.writeln("</li>");
		
		j++;

	}

	i++;
		
}