It may be easier to create a global instead of attempting this in the template, but I'm not sure if you can determine the page the user is viewing (nh variable) from a global. Has anyone ever created something that does this?
Sean
Sean