Forum Moderators: open
At present search engines do not follow javascript links so I am pretty sure that they won't be able to 'see' the links created from your js function call.
Why not use server side includes (SSI) to 'call' the navigation file. That way the two files are merged on the server before being served to the visitor / spider and they will appear as one.