function displaycalendar (display) {
	document.getElementById('calendar').innerHTML=display;

	//Stylistic Info
	var cells = document.getElementById('calendar').getElementsByTagName('td');
	var length = cells.length;
	for (i=0;i<length;i++) {
		var a = cells[i].getElementsByTagName('a');
		if ( a.length == 1 ) {
			cells[i].style.backgroundColor="orange";
		}
	}

	return false;
}

start = "<div class='cinfo'>";
back = "<p><a href='' onclick='return displaycalendar(ctable)'>Back to Calendar</a></p></div>";

c = new Array();

c[1] = start;
c[1] = c[1] + "<p>Thu. July 1 at 12:00 PM<br />";
c[1] = c[1] + "Youth Circus Showcase at the City Museum<br />";
c[1] = c[1] + back;

c[2] = start;
c[2] = c[2] + "<p>Fri. July 2 at 12:00 PM<br />";
c[2] = c[2] + "Youth Circus Showcase at the City Museum<br />";
c[2] = c[2] + back;

c[3] = start;
c[3] = c[3] + "<p>Sat. July 3 at 3:30 PM<br />";
c[3] = c[3] + "St. Louis Arches perform at Fair St. Louis, K-Town Kids Zone<br />";
c[3] = c[3] + back;

c[5] = start;
c[5] = c[5] + "<p>Mon. July 5 at 12:00 PM<br />";
c[5] = c[5] + "Youth Circus Showcase at the City Museum<br /><br />";
c[5] = c[5] + "Mon. July 5 at 2:00 PM<br />";
c[5] = c[5] + "Circus Summer Camp Performers at the City Museum<br />";
c[5] = c[5] + back;

c[6] = start;
c[6] = c[6] + "<p>Tues. July 6 at 12:00 PM<br />";
c[6] = c[6] + "Youth Circus Showcase at the City Museum<br /><br />";
c[6] = c[6] + "Tues. July 6 at 2:00 PM<br />";
c[6] = c[6] + "Circus Summer Camp Performers at the City Museum<br />";
c[6] = c[6] + back;

c[7] = start;
c[7] = c[7] + "<p>Wed. July 7 at 12:00 PM<br />";
c[7] = c[7] + "Youth Circus Showcase at the City Museum<br /><br />";
c[7] = c[7] + "Wed. July 7 at 2:00 PM<br />";
c[7] = c[7] + "Circus Summer Camp Performers at the City Museum<br />";
c[7] = c[7] + back;

c[8] = start;
c[8] = c[8] + "<p>Thu. July 8 at 12:00 PM<br />";
c[8] = c[8] + "Youth Circus Showcase at the City Museum<br /><br />";
c[8] = c[8] + "Thu. July 8 at 2:00 PM<br />";
c[8] = c[8] + "Circus Summer Camp Performers at the City Museum<br /><br />";
c[8] = c[8] + "Thu. July 8 at 7:50 PM PM<br />";
c[8] = c[8] + "Youth Circus Showcase at St. Louis Place Park<br />";
c[8] = c[8] + back;

c[9] = start;
c[9] = c[9] + "<p>Fri. July 9 at 12:00 PM<br />";
c[9] = c[9] + "Youth Circus Showcase at the City Museum<br />";
c[9] = c[9] + back;

c[12] = start;
c[12] = c[12] + "<p>Mon. July 12 at 12:00 &amp; 2:00 PM<br />";
c[12] = c[12] + "Youth Circus Showcase at the City Museum<br />";
c[12] = c[12] + back;

c[13] = start;
c[13] = c[13] + "<p>Tues. July 13 at 12:00 &amp; 2:00 PM<br />";
c[13] = c[13] + "Youth Circus Showcase at the City Museum<br />";
c[13] = c[13] + back;

c[14] = start;
c[14] = c[14] + "<p>Wed. July 14 at 12:00 &amp; 2:00 PM<br />";
c[14] = c[14] + "Youth Circus Showcase at the City Museum<br />";
c[14] = c[14] + back;

c[15] = start;
c[15] = c[15] + "<p>Thu. July 15 at 12:00 &amp; 2:00 PM<br />";
c[15] = c[15] + "Youth Circus Showcase at the City Museum<br />";
c[15] = c[15] + back;

c[16] = start;
c[16] = c[16] + "<p>Fri. July 16 at 12:00 PM<br />";
c[16] = c[16] + "Youth Circus Showcase at the City Museum<br />";
c[16] = c[16] + back;

c[19] = start;
c[19] = c[19] + "<p>Mon. July 19 at 12:00 PM<br />";
c[19] = c[19] + "Youth Circus Showcase at the City Museum<br /><br />";
c[19] = c[19] + "<p>Mon. July 19 at 2:00 PM<br />";
c[19] = c[19] + "Circus Summer Camp Performers at the City Museum<br />";
c[19] = c[19] + back;

c[20] = start;
c[20] = c[20] + "<p>Tues. July 20 at 12:00 PM<br />";
c[20] = c[20] + "Youth Circus Showcase at the City Museum<br /><br />";
c[20] = c[20] + "<p>Tues. July 20 at 2:00 PM<br />";
c[20] = c[20] + "Circus Summer Camp Performers at the City Museum<br />";
c[20] = c[20] + back;

c[21] = start;
c[21] = c[21] + "<p>Wed. July 21 at 12:00 PM<br />";
c[21] = c[21] + "Youth Circus Showcase at the City Museum<br /><br />";
c[21] = c[21] + "Wed. July 21 at 2:00 PM<br />";
c[21] = c[21] + "Circus Summer Camp Performers at the City Museum<br /><br />";
c[21] = c[21] + "Israeli performances by the Galilee Arches (combined troupe of Galilee Circus and St. Louis Arches)<br /><br />";
c[21] = c[21] + "Wed. July 21 at 11:00 AM - Performance in town of Sajur<br />";
c[21] = c[21] + "Wed. July 21 at 6:30 PM - Performance in Dir El Assad<br />";
c[21] = c[21] + back;

c[22] = start;
c[22] = c[22] + "<p>Thu. July 22 at 12:00 PM<br />";
c[22] = c[22] + "Youth Circus Showcase at the City Museum<br /><br />";
c[22] = c[22] + "<p>Thu. July 22 at 2:00 PM<br />";
c[22] = c[22] + "Circus Summer Camp Performers at the City Museum<br /><br />";
c[22] = c[22] + "Israeli performances by the Galilee Arches (combined troupe of Galilee Circus and St. Louis Arches)<br /><br />";
c[22] = c[22] + "Thu. July 22 at 6:30 PM - Performance Ba'aneh (adjacent to Dir El Assad)<br />";
c[22] = c[22] + back;

c[23] = start;
c[23] = c[23] + "<p>Fri. July 23 at 12:00 PM<br />";
c[23] = c[23] + "Youth Circus Showcase at the City Museum<br /><br />";
c[23] = c[23] + "<p>Fri. July 23 at 2:00 PM<br />";
c[23] = c[23] + "Circus Summer Camp Performers at the City Museum<br /><br />";
c[23] = c[23] + "Israeli performances by the Galilee Arches (combined troupe of Galilee Circus and St. Louis Arches)<br /><br />";
c[23] = c[23] + "Fri. July 23 at 11:00 AM - Performance in Karmiel<br />";
c[23] = c[23] + "Fri. July 23 at 6:00 PM - Performance at Nes Ammim<br />";
c[23] = c[23] + back;

c[25] = start;
c[25] = c[25] + "<p>Israeli performances by the Galilee Arches (combined troupe of Galilee Circus and St. Louis Arches)<br /><br />";
c[25] = c[25] + "Sun. July 25 at 2:00 PM - Performance at Ein Hayam Jewish-Arab Community Center<br />";
c[25] = c[25] + "Sun. July 25 at 5:00 PM - Performance at Chesed Center, Haifa (Christian Community Center)<br />";
c[25] = c[25] + back;

c[26] = start;
c[26] = c[26] + "<p>Mon. July 26 at 12:00 &amp; 2:00 PM<br />";
c[26] = c[26] + "Youth Circus Showcase at the City Museum<br /><br />";
c[26] = c[26] + "<p>Israeli performances by the Galilee Arches (combined troupe of Galilee Circus and St. Louis Arches)<br /><br />";
c[26] = c[26] + "Mon. July 26 at 10:00 AM - Performance in Yokneam at Mishmar Ha'emek, and workshops (Partnership 2000)<br />";
c[26] = c[26] + back;

c[27] = start;
c[27] = c[27] + "<p>Tues. July 27 at 12:00 &amp; 2:00 PM<br />";
c[27] = c[27] + "Youth Circus Showcase at the City Museum<br />";
c[27] = c[27] + back;

c[28] = start;
c[28] = c[28] + "<p>Wed. July 28 at 12:00 &amp; 2:00 PM<br />";
c[28] = c[28] + "Youth Circus Showcase at the City Museum<br />";
c[28] = c[28] + "<p>Israeli performances by the Galilee Arches (combined troupe of Galilee Circus and St. Louis Arches)<br /><br />";
c[28] = c[28] + "Wed. July 28 at 10:00 AM - Performance at Jerusalem YMCA<br />";
c[28] = c[28] + back;

c[29] = start;
c[29] = c[29] + "<p>Thu. July 29 at 12:00 &amp; 2:00 PM<br />";
c[29] = c[29] + "Youth Circus Showcase at the City Museum<br />";
c[29] = c[29] + back;

c[30] = start;
c[30] = c[30] + "<p>Fri. July 30 at 12:00 &amp; 2:00 PM<br />";
c[30] = c[30] + "Youth Circus Showcase at the City Museum<br />";
c[30] = c[30] + back;


//MAKE SURE TO TAKE OUT THIS LINE TOWARDS THE END ctable = ctable + "<tr></tr>";
ctable = "<table><tr><td colspan='7'>July, 2010</td></tr>";
ctable = ctable + "<tr><td>S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td></tr>";
ctable = ctable + "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>1</td><td>2</td><td>3</td></tr>"; 
ctable = ctable + "<tr><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td></tr>"; 
ctable = ctable + "<tr><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td></tr>"; 
ctable = ctable + "<tr><td>18</td><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td><td>24</td></tr>"; 
ctable = ctable + "<tr><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td><td>31</td></tr>"; 
ctable = ctable + "</table>";


		for(i=1;i<=31;i++) {
			if(c[i]) {
				var td = "<td>" + i + "</td>"
				var tda = "<td><a href='' onclick='return displaycalendar(c[" + i + "])'>" + i + "</a></td>";
				var ctable = ctable.replace(td, tda);
			}
		}

displaycalendar(ctable);