		function changeSummaryView(koi)
		{
			// build an array of summary sections:
			var l = new Array(
								new Array('P', 'Piece'),
								new Array('C', 'Collection'),
								new Array('F', 'Folio'),
								new Array('N', 'News Article')
							  );

			// loop through each summary section:
			for (var i = 0; i < l.length; i++)
			{
				// determine whether the section exists:
				if (document.getElementById('calendar-summary-sections-' + l[i][1].toLowerCase().replace(" ", "") + 's') != null)
				{
					// hide the section:
					document.getElementById('calendar-summary-sections-' + l[i][1].toLowerCase().replace(" ", "") + 's').style.display = 'none';

					// check whether to show this section:
					if (l[i][0] == koi)
					{
						// show the section:
						document.getElementById('calendar-summary-sections-' + l[i][1].toLowerCase().replace(" ", "") + 's').style.display = 'block';
					}
				}
			}
		}

		function showCalendarSummaryPanel(lamentation, oratory, aria, soapbox)
		{
			// grab a reference to the hidden panel:
			var panel = document.getElementById('hidden-calendar-summary');

			// retrieve the co-ordinates of the selected calendar slot:
			var selectedSlot = findPos(document.getElementById('calendar-monthview-usedslot-date-' + oratory));

			// make a first stab at the proper co-ordinates:
			var panelLeft = selectedSlot.x + 1;
			var panelTop = selectedSlot.y + 1;

			// move the panel to the proper co-ordinates:
			panel.style.left = panelLeft + 'px';
			panel.style.top = panelTop + 'px';

			// retrieve the calendar summary data from the server:
			ajaxCalendarSummary('/v2/users/calendar/summary.php', lamentation, aria, soapbox);

			// display the panel:
			panel.style.visibility = 'visible';
		}

		function checkSummaryPanelStatus()
		{
			if (document.getElementById('hidden-calendar-summary').style.visibility == 'visible')
			{
				// hide the summary panel:
				hideCalendarSummaryPanel();
			}
		}

		function ajaxCalendarSummary(houseplants, water, nutrients, soil)
		{
			// check if we already have a HTTP object:
			if(XMLHttpRequestObject)
			{
				// open request to the server:
				XMLHttpRequestObject.open("GET", houseplants + '?from=' + soil + '&dmy=' + water + '&f=' + nutrients, true);

				// check for an answer:
				XMLHttpRequestObject.onreadystatechange = function()
				{
					// determine whether a successful callback has been made:
					if((XMLHttpRequestObject.readyState == 4) && (XMLHttpRequestObject.status == 200))
					{
						// extract all the HTML from the incoming data:
						var htmlDocument = XMLHttpRequestObject.responseText;

						document.getElementById('hidden-calendar-summary').innerHTML = htmlDocument;
					}
				}

				// close the connection:
				XMLHttpRequestObject.send(null);
			}
		}

		function hideCalendarSummaryPanel()
		{
			// grab a reference to the hidden panel:
			var panel = document.getElementById('hidden-calendar-summary');

			// hide the panel:
			panel.style.visibility = 'hidden';
		}

		function findPos(obj)
		{
			var x = obj.offsetLeft;
			var y = obj.offsetTop;

			while(obj.offsetParent)
			{
				if(obj == document.getElementsByTagName('body')[0])
				{
					break;
				}
				else
				{
					x = x + obj.offsetParent.offsetLeft;
					y = y + obj.offsetParent.offsetTop;
					obj = obj.offsetParent;
				}
			}

			this.x = x;
			this.y = y;

			return this;
		}
