Might be smart to adapt it and require an extra key to actually load the page, like enter.
You could also incorporate support for a browser's tabbing functionality.
As for your CSS, skip the redundant parts by grouping those under a common class instead of using their ids.
The same can be done on your JS, you are not actually checking the actual link, so give them a common class and assign the functions to that class.