/**
 * Creates the menu for my website.
 * 
 * @author Christine
 */


document.write("<ul class=\"MenuTop\">");

/* Home */
writeSubMenu("Home", "index.html", [], []);
/* Papers */
writeSubMenu("Papers", [], ["Guided Harmonic Sinusoid Estimation", "Solo Voice Detection", "Older Stuff"], 
	["guided_harmonic_sinusoid.html","solo_voice_detection.html" ,"older_stuff.html"]);
/* Tools */
writeSubMenu("Tools",[],["Java Karaoke Midi Tools"],["karaoke_midi.html"]);
/* Classes */
writeSubMenu("Classes", [], ["ELEN E4810", "ELEN E6820", "COMS W4772"], ["ELEN_E4810/final_dsp_project.html", "ELEN_E6820/index.html", "COMS_W4772/Final_Project.html"]);
/* Resume */
/*writeSubMenu("Resume", "resume.html", [], []);*/

document.write("</ul>");


function writeSubMenu(parent, parentLink, children, childrenLinks){
    document.write("<li>");
	
	/* first do the parent */
    if (parentLink != null && parentLink.length != 0) {
        document.write("<a href=\"" + parentLink + "\">" + parent + "</a>");
    }
    else {
        document.write(parent);
    }
    
    /* now the children */
    if (children != null) {
        document.write("<ul class=\"MenuInner\">");
        for (i = 0; i < children.length; i++) {
            document.write("<li>");
            if (childrenLinks[i] != null) {
                document.write("<a href=\"" + childrenLinks[i] + "\">" + children[i] +
                "</a>");
            }
            else {
                document.write(children[i]);
            }
            document.write("</li>");
        }
        document.write("</ul>")
        
    }
    
    document.write("</li>");
}
