
  
  
// function to log a "pseudo page visit" to WT and GA for tracking purposes
// 2nd parameter (getURL) is not required
function linkTracker(getURLName,getURL) {
	if ((getURLName!=undefined) || (getURLName!='')) {
		if (typeof(urchinTracker)=='function') { ut=urchinTracker(getURLName); }
		if (typeof(dcsMultiTrack)=='function') { dm=dcsMultiTrack('DCS.dcsuri',getURLName); }
	}
	if ((getURL==undefined) || (getURL==null) || (getURL=='')) {
		return false;
	} else {
		setTimeout(function() {location.href=getURL}, 750);
	}
}

// link tracking when coming from Flash
// this is a duplicate function, in case we need to change it
var flashLinkTracker = linkTracker;

// for any outbound links, add an onclick to linkTracker
addEvent(window, 'load', tagOutboudLinks, false);
function tagOutboudLinks() {
    allA=document.getElementsByTagName("A"); loc=window.location; poundlink=window.location+'#';

    for (var e = 0; e < allA.length; e++) { 
    	if (allA[e] != "") { if (allA[e].hostname != undefined) { if ((allA[e] != "") && (allA[e] != poundlink) && (allA[e].hostname != loc.hostname)) { 
			//alert('*** OFFSITE LINK *** \nallA[e]: '+allA[e] + '\nallA[e].hostname: ' + allA[e].hostname + '\nallA[e].pathname: ' + allA[e].pathname + '\nloc.hostname: ' + loc.hostname);
			allA[e].onclick = function() { 
				//alert('/outgoing/link-to-'+this.hostname+(this.pathname.substr(0,1)=='/'?'':'/')+this.pathname,this);
				linkTracker('/outgoing/link-to-'+this.hostname+(this.pathname.substr(0,1)=='/'?'':'/')+this.pathname,this); 
				return false; 
				}
			}
    	//else { alert('ONSITE LINK -- a: '+allA[e] + '\nloc.hostname: ' + loc.hostname); }
    	}}}
}
