<!-- Hide script from old browsers

// The Category constructor function
function Category(name) {
    this.name = name;
    this.length = 0;
}

// The Page constructor function
function Page(name, url) {
    this.name = name;
    this.url = url;
}

// Variables to keep track of Category objects
var categories = new Array();
var categoriesIndex = -1;
var pagesIndex = -1;

// Helper function to create Category objects
function newCategory(name) {
    categoriesIndex++
    pagesIndex = -1;
    categories[categoriesIndex] = new Category(name);
}

// Helper function to create Page objects
function newPage(name, url) {
    pagesIndex++;
    categories[categoriesIndex][pagesIndex] = new Page(name, url);
    categories[categoriesIndex].length++;
}

// Function to populate the pages menu based on the selected category
function relatePages(category) {
    if (category > 0) {
        categoriesIndex = category - 1;
        var pagesMenu = document.menus.menu2;
        
        // Clear the old options
        for (var i = pagesMenu.options.length; i > 1; i--) {
            pagesMenu.options[i] = null;
        }
        
        // Add the new pages
        for (var i = 0; i < categories[categoriesIndex].length; i++) {
            pagesMenu.options[i+1] = 
                new Option(categories[categoriesIndex][i].name);
        }
        pagesMenu.options[0].selected = true;
    }
    pagesIndex = 0;
}

// Function to load the appropriate document based on selected page
function gotoPage(page) {
    var url = null;
    if (page > 0) {
        url = categories[categoriesIndex][page-1].url;
    }
    if (url != null) {
        window.location = url;
    }
}

// Create the categories and pages for relational menus
newCategory('Regions');                    									// New category 
newPage('Brazil', 'pg_regions.cfm?CE_Region_ID=br');						// Pages in category
newPage('East Africa', 'pg_regions.cfm?CE_Region_ID=eafrica');
newPage('Middle East and Turkey', 'pg_regions.cfm?CE_Region_ID=metu');		
newPage('Southern Africa', 'pg_regions.cfm?CE_Region_ID=safrica');
newPage('West Africa', 'pg_regions.cfm?CE_Region_ID=wafrica');


newCategory('Countries');                    								// New category
newPage('Brazil', 'pg_countries.cfm?InetCountryCode=BR');					// Pages in category
newPage('Burkina Faso', 'pg_countries.cfm?InetCountryCode=BF');  
newPage('Cote D\'Ivoire', 'pg_countries.cfm?InetCountryCode=CI');   		
newPage('Ethiopia', 'pg_countries.cfm?InetCountryCode=ET');
newPage('Kenya', 'pg_countries.cfm?InetCountryCode=KE');
newPage('Mali', 'pg_countries.cfm?InetCountryCode=ML');
newPage('Niger', 'pg_countries.cfm?InetCountryCode=NE');
newPage('Nigeria', 'pg_countries.cfm?InetCountryCode=NG');
newPage('Senegal', 'pg_countries.cfm?InetCountryCode=SN');
newPage('South Africa', 'pg_countries.cfm?InetCountryCode=ZA');
newPage('Tanzania', 'pg_countries.cfm?InetCountryCode=TZ');
newPage('Turkey', 'pg_countries.cfm?InetCountryCode=TR');
newPage('Zimbabwe', 'pg_countries.cfm?InetCountryCode=ZW');

newCategory('Crops');                    									// New category
newPage('Barley', 'pg_crops.cfm?Crop_Other=Barley');                		// Pages in category
newPage('Cotton', 'pg_crops.cfm?Crop_Other=Cotton');
newPage('Corn', 'pg_crops.cfm?Crop_Other=Corn');
newPage('Palm Oil', 'pg_crops.cfm?Crop_Other=Palm Oil');
newPage('Pasture', 'pg_crops.cfm?Crop_Other=Pasture');
newPage('Rice', 'pg_crops.cfm?Crop_Other=Rice');
newPage('Soybean', 'pg_crops.cfm?Crop_Other=Soybean');
newPage('Sugar', 'pg_crops.cfm?Crop_Other=Sugar');
newPage('Sisal', 'pg_crops.cfm?Crop_Other=Sisal');
newPage('Tea', 'pg_crops.cfm?Crop_Other=Tea');
newPage('Teff', 'pg_crops.cfm?Crop_Other=Teff');
newPage('Wheat', 'pg_crops.cfm?Crop_Other=Wheat');
// End hiding script from old browsers -->

