// Presenter List
var presenters = new Array(
    ["C", "Ally Lee - Roots, Rock, Riot",                   "ally_lee.html"],
    ["C", "Andrew Charlton - Business Banter",              "andrew_charlton.html"],
    ["C", "BaZ - Feel-Good Friday",                         "baz.html"],
    ["C", "Becca",                                          "becca.html"],
    ["C", "Carl Stiansen - Week-ending",                    "carl_stiansen.html"],
    ["C", "Chris Gudgeon",                                  "chris_gudgeon.html"],
    ["C", "Dave Forshaw - Folk Nite",                       "dave_forshaw.html"],
    ["C", "Daniel Mumby",                                   "daniel_mumby.html"],
    ["C", "Gerry G",                                        "gerry_g.html"],
    ["C", "John Brown - Brown's Blues &amp; Boogie",        "john_brown.html"],
    ["C", "Karl Paxton",                                    "karl_paxton.html"],
    ["C", "Laura Wilkinson",                                "laura_wilkinson.html"],
    ["C", "Lewis Denny",                                    "lewis_denny.html"],
    ["C", "Mike Whittingham - Classic Tracks",              "mike_whittingham.html"],
    ["C", "Paul Shucksmith",                                "paul_shucksmith.html"],
    ["C", "Peter Barlow - Awkward Arts",                    "peter_barlow.html"],
    ["C", "Richard Dale",                                   "richard_dale.html"],
    ["C", "Sarah McGenity",                                 "sarah_mcgenity.html"],
    ["C", "Simon Nolan",                                    "simon_nolan.html"],
    ["C", "Stevie Stewart",                                 "stevie_stewart.html"],
    ["C", "Tamsin Robson",                                  "tamsin_robson.html"],
    ["C", "Tom Wilson",                                     "tom_wilson.html"],
    ["C", "Tina Camilleri",                                 "tina_camilleri.html"],
    ["C", "Wyn Stewart - Sunday Nite Madness",              "wyn_stewart.html"],
    ["C", "Yvonne Bell - Start the Week",                   "yvonne_bell.html"],
    ["O", "Bill Grisdale &amp; David Farrar",               "bill_and_david.html"],
    ["O", "Bill Weeks",                                     "bill_weeks.html"],
    ["O", "Boydy",                                          "boydy.html"],
    ["O", "Clive Fletcher",                                 "clive_fletcher.html"],
    ["O", "Cody Pullins",                                   "cody_pullins.html"],
    ["O", "Des",                                            "des_s.html"],
    ["O", "Emma Norbury",                                   "emma_norbury.html"],
    ["O", "Frank Lyford",                                   "frank_lyford.html"],
    ["O", "Gari Sullivan - The Cultural Thing",             "gari_sullivan.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", "Martin Smith",                                   "martin_smith.html"],
    ["O", "Paul Young",                                     "paul_young.html"],
    ["O", "Pete Hegney",                                    "pete_hegney.html"],
    ["O", "Pete Wilkinson",                                 "pete_wilkinson.html"],
    ["O", "Radio Baby",                                     "radio_baby.html"],
    ["O", "Simon Jobson",                                   "simon_jobson.html"],
    ["O", "Skippy",                                         "skippy.html"],
    ["O", "St. Cloud Students",                             "scsu.html"],
    ["O", "Sue Clark",                                      "sue_clarke.html"],
    ["O", "Suzi Howey",                                     "suzi_howey.html"],
    ["O", "Tim Hills",                                      "tim_hills.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>");
    }
}

