function doSubMenu(pick) {
    dat = "";
    el = document.getElementById('submenu');
    if(pick == "where_we_work") {
        dat += '<a href="/section/heartlands">The African Heartlands</a> | ';
        dat += '<a href="/content/heartland/detail/1288">Congo</a> | ';
        dat += '<a href="/content/heartland/detail/1287">Kazungula</a> | ';
        dat += '<a href="/content/heartland/detail/1283">Kilimanjaro</a> | ';
        dat += '<a href="/content/heartland/detail/1286">Limpopo</a> | ';
        dat += '<a href="/content/heartland/detail/1282">Maasai Steppe</a> | ';
        dat += '<a href="/content/heartland/detail/1281">Samburu</a> | ';
        dat += '<a href="/content/heartland/detail/1284">Virunga</a> | ';
        dat += '<a href="/content/heartland/detail/1285">Zambezi</a>';
    }
    else if(pick == "conserving_wildlife") {
        dat += '<a href="/section/wildlife">Overview</a> | ';
        dat += '<a href="/section/wildlife/elephants">Elephants</a> | ';
        dat += '<a href="/section/wildlife/gorillas">Gorillas</a> | ';
        dat += '<a href="/section/wildlife/bonobos">Bonobos</a> | ';
        dat += '<a href="/section/wildlife/rhinos">Rhinos</a> | ';
        dat += '<a href="/section/wildlife/carnivores">Carnivores</a> | ';
        dat += '<a href="/section/wildlife/zebras">Grevy\'s Zebras</a> | ';
        dat += '<a href="/section/wildlife/otherspecies">Species Research</a> | ';
        dat += '<a href="/section/wildlife/gallery">Wildlife Gallery</a> | ';
        dat += '<a href="/section/wildlife/help">Want to Help?</a>';
    }
    else if(pick == "protecting_land") {
        dat += '<a href="/section/land">Overview</a> | ';
        dat += '<a href="/section/land/protectedareas">Protected Areas Support</a> | ';
        dat += '<a href="/section/land/landuse">Local Land Use Planning</a> | ';
        dat += '<a href="/section/land/landtrusts">Land Trusts</a> | ';
        dat += '<a href="http://shop.awf.org/acre/default.aspx">Adopt African Acres</a> | ';
        dat += '<a href="/section/land/help">Want to Help?</a>';
    }
    else if(pick == "empowering_people") {
        dat += '<a href="/section/people">Overview</a> | ';
        dat += '<a href="/section/people/enterprise">Conservation Enterprise</a> | ';
        dat += '<a href="/section/people/education">Education & Training in Africa</a> | ';
        dat += '<a href="/section/people/policy">Support African Policy Initiatives</a> | ';
        dat += '<a href="/section/people/help">Want to Help?</a>';
    }
    else if(pick == "engaging_you") {
        dat += '<a href="/section/engaging_you">Overview</a> | ';
        dat += '<a href="/section/engaging_you/donate">Donate</a> | ';
        dat += '<a href="/section/engaging_you/monthly">Monthly Giving</a> | ';
        dat += '<a href="/section/engaging_you/renew">Renew</a> | ';
        dat += '<a href="http://shop.awf.org/adopt/">Adopt an Animal</a> | ';
        dat += '<a href="/section/engaging_you/getcc">Get AWF Credit Card</a> | ';
        dat += '<a href="javascript:openwin(0);">Sign-up for eNews</a> | ';
        dat += '<a href="/section/engaging_you/corporate">For Foundations & Corporations</a>';
    }
    else if(pick == "about_awf") {
        dat += '<a href="/section/about">Overview</a> | ';
        dat += '<a href="/section/about/history">AWF\'s History</a> | ';
        dat += '<a href="/section/about/ourstaff">Our Staff</a> | ';
        dat += '<a href="/section/about/trustees">Trustees</a> | ';
        dat += '<a href="/section/about/ourpartners">Partners</a> | ';
        dat += '<a href="/section/about/corporate">Corporate Supporters</a> | ';
        dat += '<a href="/section/about/resources">Resources & Documents</a> | ';
        dat += '<a href="/section/about/newsroom">News Room</a> | ';
        dat += '<a href="/section/about/jobs">Jobs</a> | ';
        dat += '<a href="/section/about/contactus">Contact Us</a>';
    }
    else {
        el.innerHTML = "";
        el.style.background = "transparent";
    }
    if(dat != "") {
        el.style.background = "url('/images/submenu_bg.gif')";
        el.innerHTML = dat;
    }
};

function countdownTimer() {
    doSubMenu();
}

function isActiveLink(e) {
    // Javascript sees links as separate elements, so the submenu would normally close when hovering
    // over a link with 'onMouseOut'. This bypasses that by specifying y <= 60.
    
    var posy = 0;
    if (!e) var e = window.event;
    if (e.pageY) {
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY) {
        posy = e.clientY;
    }
    if(posy <= 60 || posy >= 109) {
        timeoutID = setTimeout("countdownTimer()",4000);
        //doSubMenu();
    }
};
