// Presenter List
var presenters = new Array(
	["C", "Ally Lee",							"ally_lee.html"],
	["C", "Becca",								"becca.html"],
	["C", "Boydy",								"boydy.html"],
	["C", "Carl Stiansen",						"carl_stiansen.html"],
	["C", "Chris Gudgeon",						"chris_gudgeon.html"],
	["C", "Dave Forshaw",						"dave_forshaw.html"],
	["C", "Emma Norbury",						"emma_norbury.html"],
	["C", "Gari Sullivan",						"gari_sullivan.html"],
	["C", "Gerry G",							"gerry_g.html"],
	["C", "Lewis Denny",						"lewis_denny.html"],
	["C", "Paul Young",							"paul_young.html"],
	["C", "Paul Shucksmith",					"paul_shucksmith.html"],
	["C", "Richard Dale",						"richard_dale.html"],
	["C", "Simon Nolan",						"simon_nolan.html"],
	["C", "Simon Jobson",						"simon_jobson.html"],
	["C", "Suzi Howey",							"suzi_howey.html"],
	["O", "Bill Grisdale &amp; David Farrar",	"bill_and_david.html"],
	["O", "Bill Weeks",							"bill_weeks.html"],
	["O", "Clive Fletcher",						"clive_fletcher.html"],
	["O", "Des",								"des_s.html"],
	["O", "Frank Lyford",						"frank_lyford.html"],
	["O", "Gary Brown (the elder)",				"gary_brown_the_elder.html"],
	["O", "George Millar",						"george_millar.html"],
	["O", "Hayden Parker",						"hayden_parker.html"],
	["O", "John Bailey",						"john_bailey.html"],
	["O", "Radio Baby",							"radio_baby.html"],
	["O", "Skippy",								"skippy.html"],
	["O", "St. Cloud Students",					"scsu.html"],
	["O", "Stevie Stewart",						"stevie_stewart.html"],
	["O", "Sue Clark",							"sue_clarke.html"],
	["O", "Tim Hills",							"tim_hills.html"],
	["O", "Tom Wilson",							"tom_wilson.html"],
	["O", "Tina Camilleri",						"tina_camilleri.html"],
	["O", "Zad Corp",							"zad_corp.html"]
);


// Generate the link text
function makeLink(i) {
	return '<a href="presenters/' + 
			presenters[i][2] + '">' + 
			presenters[i][1] + '</a>';
}


// Generate the HTML for the presenter category
function writePresenterTable(category) {
	var count = 0;
	var first = -1;
	var last  = -1;
	for (var i = 0; i < presenters.length; i++) {
		if (category == presenters[i][0]) {
			if (first == -1)
				first = i;
			last = i;
			count++;
		}
	}
	
	if (category == "C")
		var className = "index_current";
	else
		var className = "index_other";
	
	if (count > 0) {
		offset = Math.round(count / 2);
		for (var i = first; i < (first + offset); i++) {
			document.write("<tr>");
			document.write("<td class=" + className + ">");
			document.write(makeLink(i));
			document.write("</td>");
			if ((i + offset) <= last) {
				document.write("<td class=" + className + ">");
				document.write(makeLink(i + offset));
				document.write("</td>");
				document.write("</tr>");
			}
		}
		document.write("<tr>");
		document.write("<td colspan=\"2\">");
		document.write("<br />");
		document.write("</td>");
		document.write("</tr>");
	}
}
