that menu is created basically by passing an array of blocks to the function, custom_showblocks, which can be found in lib-custom.php, which is then passed to COM_siteHeader to control which blocks appear--basically you can control what blocks appear on any given page. Blaine has provided a bit of documentation in lib-custom.php for that function.
check out the code in my functions.php. also see this
discussion here.