function hrefAssignHandler(collection, regExp, eventHandler){
	//loop through all the links in the CLEAN collection
	collection.each(function(link){
		if (link.getAttribute('href').match(regExp)){
			Event.observe(link, 'mouseup', eventHandler);
		}
	});
	
}



function trackPageViews(){	
	//regexp that will be fed in to look for PDF, XLS, etc
	var regExp = /\w+\.(pdf|doc|xls|mov|avi|mpg|mp3|ppt|swf|flv|mp4|m4a|m4b|wmv|wma)$/;
	
	//this is the page initialization script, which should be organized better
	var pageTracker = _gat._getTracker("UA-3384442-1");
		pageTracker._initData();
		//this tracks the current page
		pageTracker._trackPageview();
		
	//function to call when link is pressed	
	var handler = function(e){
		//this tracks the pdf download
		pageTracker._trackPageview(this.href);	
	}
	
	if ($('container')){
		var PDFs = $('container').select('a[href]');	 
		hrefAssignHandler(PDFs, regExp, handler);
	}
 	
};

Event.observe(window, 'load', trackPageViews);