// Add new links to this array, in the format:
// "Title text", "link destination", "css class name", "subsection"
// leave css class name as the empty string "" if none is needed

var links = new Array();
links.push(new Array("Home", "index.html", "free_item"));



links.push(new Array("China & India", "chinaindia.htm", "projects"));
links.push(new Array("H. R. for Health", "health.htm", "projects", "ci"));
links.push(new Array("Program Staff", "chinaindiastaff.htm", "projects", "ci"));
links.push(new Array("Kolkata Group", "kolkata.htm", "projects", "ci"));
links.push(new Array("Publications", "chinaindiapubs.htm", "projects", "ci"));

links.push(new Array("Capabilities", "capabilities.htm", "projects"));
links.push(new Array("Training", "capabilitytraining.htm", "projects", "capabilities"));
links.push(new Array("Measuring Agency", "capabilitystudy.htm", "projects", "capabilities"));
links.push(new Array("Publications", "capabilitiespubs.htm", "projects", "capabilities"));

links.push(new Array("Human Security", "security.htm", "pastprojects"));
links.push(new Array("Children & AIDS", "childrenandaids.htm", "pastprojects", "security"));
links.push(new Array("Darfur", "darfur.htm", "pastprojects", "security"));
links.push(new Array("Publications", "security_pubs.htm", "pastprojects", "security"));

links.push(new Array("Philanthropy", "philanthropy.htm", "pastprojects"));
links.push(new Array("Diaspora Research", "diaspora.htm", "pastprojects", "philanthropy"));
links.push(new Array("NGO Forum", "ngoforum.htm", "pastprojects", "philanthropy"));
links.push(new Array("Publications", "philanthropy_pubs.htm", "pastprojects", "philanthropy"));

links.push(new Array("Mission", "mission.htm", "about"));

links.push(new Array("People", "people.htm", "about"));

links.push(new Array("Publications", "publications.htm", "about"));
links.push(new Array("GEI Books", "books_journals.htm", "about", "pubs"));
links.push(new Array("Staff Publications", "staff_pubs.htm", "about", "pubs"));

links.push(new Array("Contact", "contact.htm", "about"));

links.push(new Array("Search", "search.htm", "free_item"));



var headlines = new Array();
headlines["projects"] = "Projects";
headlines["pastprojects"] = "Past Projects";
headlines["about"] = "About GEI";

// hash of subsections which should only be expanded when
// we've navigated to their titlepages
var subsections = new Array();
subsections["capabilities"] = 1;
subsections["philanthropy"] = 1;
subsections["pubs"] = 1;
subsections["security"] = 1;
subsections["ci"] = 1;


// writeLinks(curSubsection)
function writeLinks(curSubsection) {
    var last_section = "";
    for (var i=0; i < links.length; i++) {
        var section = links[i][2];
        var subsection = links[i][3];
        if (subsection && subsections[subsection] && 
            curSubsection != subsection) {
            continue;
        }
        if (section != last_section && headlines[section]) {
            document.write ("<h2>" + headlines[section] + "</h2>");
        }
        var linkClass = "";
        if (document.URL.indexOf(links[i][1]) == 
            document.URL.length - links[i][1].length) {
            linkClass = " class=\"selected\"";
        } 
        var headingTag = subsection ? "h4" : "h3";
        document.write ("<" + headingTag + " class=\"" + section + 
                        "\"><a href=\"" + links[i][1] + "\"" + linkClass + 
                        ">" + links[i][0] + "</a></" + headingTag + ">");
        last_section = section;
    }
}
