Testing for taxonomy On my website, I have used the Taxonomy to created different sections. Each section has its own "contact us" page. I want to create a variable that will create a path to the relevant contact page. That way I can print the variable in taxonomy-term.tpl.php, node.tpl.php and page.tpl.php files to print the path dynamically. 

How can I test for the taxonomy, and then change the value of the variable accordingly?

I've looked around for an answer and the closest I could find was How to move custom code into template.php. However, it requires a taxonomy reference field to present to perform the test and so wont work on the main taxonomy index pages (which cannot have taxonomy field references).

EDIT: Please note: The contact us page is just a normal node with telephone numbers on it. It is not the Drupal contact us form.
There is a Drupal Dojo video that answers this exact question. It is done in Drupal 6 but might give you some clues how to accomplish this in Drupal 7.

(edit: Response to comment) Although it might add complexity to developing your website, you can use the Context module to trigger block visibility based on certain criteria such as a View being viewed or a taxonomy term page being viewed. Keep in mind that if the Context module is used with all blocks disabled in the block UI it gives a performance boost to the website.