You could write a Javascript function that returns the
stripped-down name of the page being viewed, and embed that in
value attribute of the a href tag. The location property of the
window object in Javascipt contains the name of the current page.
Then you can parse it out of that string with the split() function,
using the \ and . as delimiters.
Or, there are variables in the CGI scope for PHP or whatever
languages you are using. You could parse the page name out of that
string using string manipulation functions in the particular
language.