function GAXDomain(elem) {
	if (typeof pageTracker != "undefined") {
		var oldHTML = elem.innerHTML;
		elem.href = pageTracker._getLinkerUrl(elem.href);
		elem.innerHTML = oldHTML;
	}
	else {
		_gaq.push(function () {
			var t = _gat._getTrackerByName();
			var oldHTML = elem.innerHTML;
			elem.href = t._getLinkerUrl(elem.href, false);
			elem.innerHTML = oldHTML;
		});
	}

}

$(document).ready(function () {
	if (typeof pageTracker != "undefined" || typeof _gaq != "undefined") {
		var re = /^https?:\/\/(www\.)?(duckhorn|paraduxx|goldeneyewinery|migrationwines|decoywines|duckhornwineshop|duckhornwinecompany|cart\.bloyal)\.com\//i;

		var hn = document.location.hostname;
		var hnmatch = hn.match(/(?:www\.)?(.*)/);

		if (hnmatch !== null)
			hn = hnmatch[1];

		var hnre = new RegExp("^https?://(www\.)?" + hn, "i");

		$("a").each(function () {
			if (re.test(this.href) && !hnre.test(this.href)) {
				GAXDomain(this);
			}
		});
	}
});
