
			var iRowCount = 0;

			// Convert <>"'& to the corresponding entities
			// ### The prototype spans 2 lines so that it doesn't get picked up by the
			// PHP doc generator.  A bit crude I know, but it's easier than making the
			// doc generator fully PHP syntax aware.
			function htmlspecialchars(
									Source) {
				Target = new String(Source)
				Target = Target.replace(/&/g, '&amp;');
				Target = Target.replace(/</g, '&lt;');
				Target = Target.replace(/>/g, '&gt;');
				Target = Target.replace(/\"/g, '&quot;');
				Target = Target.replace(/\'/g, '&#039;');
				return Target;
			}

			// Display a record
			function DrawShortSong(SongId, FirstLine, Count) {

				if (iRowCount % 2) {
					document.writeln('\t<tr>');
				} else {
					document.writeln('\t<tr bgcolor="#EEEEEE">');
				}

				document.writeln('<td width="5%">' + htmlspecialchars(Count) + '</td>');
				document.writeln('<td>' + htmlspecialchars(FirstLine) + '</td>');

								document.writeln('\t\t<th class="listEntry" width="5%" align="left">'
						+ '<a href="/serviceplanner/eventitemstats.php?Action=View Song&SongId=' + SongId + '"><span style="white-space: nowrap; margin-left:10px;margin-right:10px">Services</span></a>'
						+ '</th>\n');
									document.writeln('\t\t<th class="listEntry" width="5%" align="left">'
						+ '<a href="/songs/index.php?Action=View Record&RecordId=' + SongId + '"><span style="white-space: nowrap; margin-left:10px;margin-right:10px">Song</span></a>'
						+ '</th>\n');
					
				document.writeln('\t</tr>');

				iRowCount++;
			}

			// Display a record
			function DrawShortEvent(EventId, StartTime, Type, Organizer, Preacher, Location) {

				if (iRowCount % 2) {
					document.writeln('\t<tr>');
				} else {
					document.writeln('\t<tr bgcolor="#EEEEEE">');
				}

				document.writeln('\t\t<th class="listEntry" align="left">'
					+ '<a href="eventcontent.php?EventId=' + EventId + '">View</a>'
					+ '</th>\n');

										document.writeln('<td>');
						{
							var iDate = StartTime;
							var oDate = new Date(parseInt(StartTime) * 1000);
							var sDate = new String(oDate.toLocaleString());
							// Trim off the seconds before printing
							var Re = new RegExp(':[0-9]*$');
							document.writeln(sDate.replace(Re, ''));
						}
						document.writeln('</td>');
												document.writeln('<td>' + htmlspecialchars(Type) + '</td>');
												document.writeln('<td>' + htmlspecialchars(Organizer) + '</td>');
												document.writeln('<td>' + htmlspecialchars(Preacher) + '</td>');
												document.writeln('<td>' + htmlspecialchars(Location) + '</td>');
						
				document.writeln('\t</tr>');

				iRowCount++;
			}
		