(function () { 
		   
	var hrefs = document.getElementsByTagName("a");
	var link_path = "";
	var firstHash;
	for (var l = 0; l < hrefs.length; l++) {
			try {
				var link_path = hrefs[l].pathname;
				if (location.host == hrefs[l].hostname) {
					if (link_path.match(/\.(doc|docx|pdf|xls|ppt|zip|gz|bz2|rar|txt|vsd|vxd|js|css|exe|wma|mov|avi|wmv|mp3|mp4)$/)) {
						hrefs[l].onclick = function() { 
							trackfiles(this, "/download/"); 
							return false; 
						};
					}
				} else if (hrefs[l].href.indexOf("mailto:") === 0) {
					hrefs[l].onclick = function() {
						trackfiles(this, "/mailto/");
						return false;
					};
				} else if (!hrefs[l].hostname.match(/roirevolution.com|claricesmithcenter.umd.edu|shadowboxer.umd.edu/)) {
					hrefs[l].onclick = function() {
						trackfiles(this, "/outbound/");
						return false;
					};
				}
			} catch(err) { }
	}
	
	function trackfiles(array_element, trackType) {
		if (array_element.srcElement) {
			array_element = array_element.srcElement;
		}
		file_path = trackType === "/download/" ? array_element.pathname : array_element.href;
		file_path = (trackType + file_path.replace(/mailto:|http:\/\//,"")).replace(/\/\//,"/");
		_gaq.push(['_trackPageview', file_path]);
		window.setTimeout(function() { 
			location.href=array_element.href; 
		}, 300); 
	}
}());
