I'll look at it when I get time more than likely the weekend. I am swamped in work right now
p.s. there is a little more to it than the code you posted. Again If i get time I will look at it. It shouldn't be too hard to do. as for the other links it depends if they follow the same formatting of the ../content/printVersion/IDnumber or not. If they do then that would be rather simple. If the url is totally different then a series of if statements might be utilized to check what the index url is and then work accordingly.
In the meantime consider getting these things
1) Ultra-Edit
2) Firebug for firefox
Without the above programs (my personal opinion) you are chasing your tail trying to find code you want. With ultra-edit you can simply take and cheat like i do and search the built in recipes for code. For example you could look up print_version and you would see all the recipes that use that and see how they did it and why they did it that way. Then with firebug you can right click on the element in the html and you can get its corresponding tag. for instance if the content is only in a div tag with the class name of content. like <div class='content'> blah blah blah </div>
and we don't want anything else then we could use keep_only_tags and so forth. see what you can come up with in the meantime and i will help when i can.