I want to add some google analytics code to a link to track downloads of PDF files.

This is an example of the onclick event for a normal link -

Code:
<a href="http://www.example.com/files/map.pdf" onClick="javascript:urchinTracker ('/downloads/map'); ">
The link i want to add this to is built using javascript as there are a number of different PDF files and so the link dynamically populates the filename from an array.

Code:
new_element = SetAttributes(new_element,'href:' + brochureTitles[(index)][1] + ';title:download '+brochureTitles[(index)][0]+' brochure - ('+brochureTitles[(index)][4]+' Adobe PDF document);target:_blank');
so i just need to add in the onclick event to the code above and ideally be able to track which PDF is downloaded so replace map in the below example with the brochure title.

Code:
onClick="javascript:urchinTracker ('/downloads/map'); ">
thanks