/*
/* Create menu separator.
/* Usage: mk_menu_sep( )
/*/
function mk_menu_sep( ) {
	document.write( '<li class="sep">--- --- ---</li>' );
}

/*
/* Create menu-link blocks.
/* Usage: mk_menu_link( "libFWheel", "libfwheel.html", ["About", "about", "Downloads", "dl", "News", "news"] )
/*/
function mk_menu_link( m_title, m_url, m_sections ) {
	var page = window.location.href.match( /\w+\.html|htm/ )
	if( page == null ) { page = "index.html" }

	if( page == m_url ) {
		document.write( '<li class="current">' + m_title );
	} else {
		document.write( '<li><a href="' + m_url + '">' + m_title + '</a>' );
	}

	if( m_sections.length > 0 ) {
		document.write( '<ul><li class="first"><strong>' + m_title + '</strong></li>' );
		for( var i = 0; i < m_sections.length; i+=2 ) {
			document.write( '<li><a href="' + m_url + '#' + m_sections[ i + 1 ] + '">' + m_sections[ i ] + '</a></li>' );
		}
		document.write( '</ul>' );
	}

	document.write( '</li>' );
}

/*
/* Create menu bar content.
/* Usage: mk_menu( )
/*/
function mk_menu( ) {
	document.write( '<div id="sidebar"><ul id="nav">' );

	mk_menu_link( "Introduction", "index.html", [ ] );
	mk_menu_link( "Useful Links", "links.html", ["Intranet", "intra", "Continuing Education", "conted", "Programming Languages", "plang"] );
	mk_menu_link( "Restricted", "restricted/", [ ] );
	mk_menu_link( "My Resume", "dcurley.pdf", [ ] );
	mk_menu_sep( );
	mk_menu_link( "Trace.rb", "tracerb.html", ["About", "about", "How it Works", "how", "Downloads", "dl"] );
	mk_menu_link( "Project A", "projecta.html", ["a", "a", "b", "b"] );
	mk_menu_link( "libFWheel", "libfwheel.html", ["About", "about", "Downloads", "dl", "News", "news"] );
	mk_menu_link( "NetMario", "netmario.html", ["Disclaimer", "discl", "About", "about", "Downloads", "dl"] );

	document.write( '</ul></div>' );
}

/*
/* From: http://alistapart.com/articles/dropdowns/
/*/
startList = function( ) {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");

		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];

			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

window.onload=startList;

