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 -

<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.

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.

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