/* -----------------------------------------------
Title: Metrics Setup File
Author: Jarid Love
Modified: 2 Dec 2010 by Jarid Love
          "Added Header Link Checking"
----------------------------------------------- */

// begin google analytics code
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
var gaNovellKey = "UA-3367212-1";
var gaNovellKey_video = "UA-9518721-1";
if((typeof isStage != "undefined" && isStage) || (typeof isTest != "undefined" && isTest) || (typeof isDev != "undefined" && isDev)) {
	gaNovellKey = "UA-3367212-4";
	gaNovellKey_video = "UA-9518721-3";
}
// end google analytics code

// header link tracking
var hasjQuery = jQuery || false;
if(hasjQuery) {
	function trackHeaderLink(val) {
		eventTracker._trackEvent('Header Links','clicks',val);
	}
	$(document).ready(function() {
		$("#hdr_lnks a").click(function() {
			if(typeof eventTracker != "undefined") {
				var parentContainer = $(this).parent();
				while(parentContainer.parent().attr("id") != "hdr_lnks") {
					parentContainer = parentContainer.parent();
				}
				trackHeaderLink(parentContainer.attr("id").replace("hdr_mnu_", "") + ": " + this.href.replace(ss,""));
				setTimeout('window.location = "' + this.href + '"', 100);
				return false;
			}
		});
		$("#hdr_home a").click(function() {
			if(typeof eventTracker != "undefined") {
				trackHeaderLink("home");
				setTimeout('window.location = "' + this.href + '"', 100);
				return false;
			}
		});
		$("#hdr_login a").click(function() {
			if(typeof eventTracker != "undefined") {
				trackHeaderLink("login");
				setTimeout('window.location = "' + this.href + '"', 100);
				return false;
			}
		});
	});
}

