			// 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 DrawRecord(title, category, url, description, dateadded, rating, votes, views, RecordId) {

				document.writeln('<table border="0" width="100%" cellpadding="2" cellspacing="1">');
				document.writeln('<tr>');
				{
					document.writeln('<td class="datecol" rowspan="3">'
							+ RecordId
							+ '</td>');
					document.writeln('<td class="dark" colspan="5" width="100%">'
							+ '<a href="/resources/links/links.php?Action=Redirect&RecordId='
								+ RecordId
								+ '&url='
								+ url
								+ '" target="_blank">'
								+ '<strong>' + htmlspecialchars(title) + '</strong>'
							+ '</a>'
							+ '<br>'
							+ '<font class="small">' + htmlspecialchars(url) + '</font><br>'
							+ '</td>');
				}
				document.writeln('</tr>');
				document.writeln('<tr>');
				{
					document.writeln('<td class="lite" colspan="6" width="100%">');
					DescriptionStr = new String(description);
					if (DescriptionStr.indexOf('<p>') == 0) {
						document.write(description);
					} else {
						document.writeln(
							'<p>'
							+ htmlspecialchars(description)
							+ '</p>');
					}
					document.writeln('</td>');
				}
				document.writeln('</tr>');
				document.writeln('<tr>');
				{
					document.writeln('<td class="datecol"><small>Added: ');
					{
						var iDate = dateadded;
						var oDate = new Date(parseInt(dateadded) * 1000);
						document.writeln(oDate.toLocaleString());
					}
					document.writeln('</small></td>');

					document.writeln('<td width="15%" class="datecol">');
					if (views != 0) {
						document.writeln(htmlspecialchars(views) + ' Views');
					}
					document.writeln('</td>');

					document.writeln('<td width="15%" align="center" class="datecol">');
					if (rating) {
						document.writeln('' + htmlspecialchars(rating) + '/10');
					}
					document.writeln('</td>');

					document.writeln('<td width="15%" class="datecol">');
					if (votes != 0) {
						document.write(htmlspecialchars(votes) + ' Vote');
						if (votes > 1) {
							document.write('s');
						}
					}
					document.writeln('</td>');
					// Ask for a teeny %, but use nobr to force it to fit on one line
					document.writeln('<td width="5%" class="ratecol">'
								+ '<a href=\"/resources/links/links.php?Action=Rate&RecordId='
										+ RecordId
										+ '\" class="rate"><nobr>Rate this site</nobr></a>'
								+ '</td>');
				}
				document.writeln('</tr>');
				document.writeln('<tr>');
				{
					document.writeln('<td class="lite" colspan="6">&nbsp;</td>');
				}
				document.writeln('</tr>');
				document.writeln('</table>');
			}
		