/****************************************************
     Author: Brian J Clifton
     Url: http://www.advanced-web-metrics.com
     This script is free to use as long as this info is left in
     
     Tracking banners and other outgoing links - Automatically
     described at: http://www.advanced-web-metrics.com/blog/2007/08/15/tracking-banners-and-other-outgoing-links-automatically/
     
     
     Use this code at your own risk.  I take no responsibility for errors or any other complications arising from the use of this code
****************************************************/

<script type="text/JavaScript">
// Only links written to the page (already in the DOM) will be tagged
// Script can be called multiple times

function addExtLinkerEvents() {
var as = document.getElementsByTagName("a");
var extTrack = ["mysite.com"];
// replace mysite.com with your web site domain

for(var i=0; i<as.length; i++) {
	var tmp = as[i].getAttribute("onclick");
	// Track links off site i.e. no GATC
	if (tmp != null && tmp.indexOf('urchinTracker') > -1) continue;
	for (var j=0; j<extTrack.length; j++) {
		if (as[i].href.indexOf(extTrack[j]) == -1) {
			var splitResult = as[i].href.split("//");
			as[i].setAttribute("onclick",((tmp != null) ? tmp : "") +
			  "urchinTracker('/ext/" + splitResult[1]+ "');");
			// the above must be on one line - from as[i]... to ");
			break;
		}
	}
}
}
addExtLinkerEvents()
</script>