//Yahoo UI Library
document.write("<scr"+"ipt type='text/javascript' src='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://oct.stratigent.com/teradata/yahoo-dom-event.js"+"'><\/scr"+"ipt>");


// ===================================================================================================
// Custom Variable Holder Declaration
// ===================================================================================================
var analyticsCustomVars = "";


// ===================================================================================================
// Onsite Search Category Detection Code
// ===================================================================================================
function checkForQ (queryString) {
   var keyValPairs = queryString.split("&");
   for (var i=0; i<keyValPairs.length; i++) {
      var pair = keyValPairs[i].split("=");
      if (pair[0] == "q") { return pair[1]; }
   }
   return "";
}

function checkForPage (pageURI) {
   var pathLevels = pageURI.split("/");
   if (pathLevels[pathLevels.length-1] == "search") { return pathLevels[1]; }
   else { return ""; }
}

var pageURI = document.location.pathname;
var queryString = document.location.search.slice(1);

if (checkForQ(queryString) != "" && checkForPage(pageURI) != "") {
   if (analyticsCustomVars != "") { analyticsCustomVars += "&"; }
   analyticsCustomVars += "scat=" + checkForPage(pageURI);
}

// ===================================================================================================
// Visitor Segmentation Code
// ===================================================================================================
// checkSegCookie() function
// 	- Returns the segmentation cookie value ("none" if no value)
var strTest;
function checkSegCookie () {
	var segPair = new Array(2);
	segPair[0] = "none";
	segPair[1] = 0;
	var theCookies = document.cookie.split("; ");
	if(theCookies.length > 0) {
		for (var i=0; i<theCookies.length; i++) {
			var tempCookie=theCookies[i].split("=");			
			if (tempCookie[0] == "__utmv") {
				if(typeof(tempCookie[1]) == undefined)  {
					tempCookie[1] = "";
				}
				else {
					try {
						var tempVal = tempCookie[1].split(".");
						if (tempVal.length == 2) {
							segPair[0]=tempCookie[1].split(".")[1];
						}
				 	}
					catch(err) { }
				}
			}
		}
	}
	if (segPair[0] == "") { segPair[0] = "none"; }
	if (segPair[0] == "Commentator") { segPair[1] = 1; }
	else if (segPair[0] == "Promoter") { segPair[1] = 2; }
	else if (segPair[0] == "Contributor") { segPair[1] = 3; }
	return segPair;
}

// ===================================================================================================
// Web Analytics JavaScript Tags
// ===================================================================================================

// ------------------------------------------------------------------------
//
// :: Google Analytics Tracking Code ::
//	Description:
//		This section refers to the Google Analytics tracking code.
//
//	Created by: Stratigent
//	Date Added: 9/24/2009
//
//	Revisions:
//		<revisions info here>
//
// ------------------------------------------------------------------------

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"));
//document.write("<scr"+"ipt type='text/javascript' src='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://oct.stratigent.com/teradata/ga1.js"+"'><\/scr"+"ipt>");
document.write("<scr"+"ipt type='text/javascript' src='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://oct.stratigent.com/teradata/ga2.js"+"'><\/scr"+"ipt>");

// ------------------------------------------------------------------------
//
// :: Webtrends Analytics Base Tags ::
//	Description:
//		This section refers to the Webtrends base tags.
//
//	Created by: Stratigent
//	Date Added: 9/24/2009
//
//	Revisions:
//		<revisions info here>
//
// ------------------------------------------------------------------------
// document.write("<scr"+"ipt type='text/javascript' src='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://oct.stratigent.com/teradata/wt1.js"+"'><\/scr"+"ipt>");
document.write("<scr"+"ipt type='text/javascript' src='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://oct.stratigent.com/teradata/wt1.js"+"'><\/scr"+"ipt>");
document.write("<scr"+"ipt type='text/javascript' src='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://oct.stratigent.com/teradata/wt2.js"+"'><\/scr"+"ipt>");
document.write("<scr"+"ipt type='text/javascript' src='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://oct.stratigent.com/teradata/wt3.js"+"'><\/scr"+"ipt>");

// ===================================================================================================
// (end of) Web Analytics JavaScript Tags
// ===================================================================================================


// event_tracking.js - contains event tracking stuff
document.write("<scr"+"ipt type='text/javascript' src='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://oct.stratigent.com/teradata/event_tracking.js"+"'><\/scr"+"ipt>");

