<!--WEBSIDESTORY CODE HBX1.0 (Universal)-->
<!--COPYRIGHT 1997-2005 WEBSIDESTORY,INC. ALL RIGHTS RESERVED. U.S.PATENT No. 6,393,479B1. MORE INFO:http://websidestory.com/privacy-->

var _hbEC=0,_hbE=new Array;function _hbEvent(a,b){b=_hbE[_hbEC++]=new Object();b._N=a;b._C=0;return b;}
var hbx=_hbEvent("pv");hbx.vpc="HBX0100u";hbx.gn="ehg-techtarget.hitbox.com";

//TT functions
//testing display
if (window.location.search.indexOf("wrData=on") != -1) document.cookie="wrData=on; path=/";
if (window.location.search.indexOf("wrData=off") != -1) document.cookie="wrData=off; path=/";

function getSearchEngineReferrer() {
  //if user is referred from search engine, mark them
  //if user remains on our sites, keep them marked
  //else remove them
  var r = document.referrer;
  var s = "";
  var t = (document.cookie.indexOf('ref=') != -1) ? document.cookie.substring(document.cookie.indexOf('ref=') + 4, document.cookie.length) : 'null';
  if (t != 'null' && t.indexOf(';') != -1) t = t.substring(0,t.indexOf(';'));
  if (t != 'null' && r.indexOf('techtarget.com') != -1) s = t;
  if (r.indexOf('google') != -1) s = 'Google';
  if (r.indexOf('search.yahoo.com') != -1) s = 'Yahoo';
  if (r.indexOf('search.msn.com') != -1) s = 'MSN';
  if (r.indexOf('web.ask.com') != -1) s = 'AskJeeves';
  if (r.indexOf('altavista') != -1) s = 'AltaVista';
  if (r.indexOf('search.aol.com') != -1) s = 'AOL Netfind';
  if (s != "") {
         document.cookie="ref="+s+"; path=/; domain=techtarget.com";
         return s;
  } else {
         return '-1';
  }
}

function getVisitorSegment() {
  //search engine referrer = 4
  var uStatus = new String();
  var vsWLP = window.location.pathname;
  uStatus += (getSearchEngineReferrer() != -1) ? "4," : "-4,"; //referred by search engine
  uStatus += ";" + uStatus; //duplicate for Global Rollup
  return uStatus;
}


function setSrcCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function getSrcCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

// used for asrc and psrc
function getArgs() {
	var args = new Object();
	var query = window.location.search.substring(1);
	var pairs = query.split("&");
	for(var i = 0; i < pairs.length; i++) {
		var pos = pairs[i].indexOf('=');
		if (pos == -1) continue;
		var argname = pairs[i].substring(0,pos);
		var value = pairs[i].substring(pos+1);
		args[argname] = unescape(value);
	}
	return args;
}


//determine if the hit is coming from a test server
var test_mlc = "";
if (window.location.hostname.indexOf(".test.") != -1 ||
	window.location.hostname.indexOf(".dev.") != -1 ||
	window.location.hostname.indexOf(".eng.") != -1 ||
	window.location.hostname.indexOf(".preview.") != -1 ||
	window.location.hostname.indexOf(".qa.") != -1 ) {
	        
    test_mlc = '/test' ;
}


//get MLC
var global_mlc, bp_mlc, rl_mlc; 

//lib_type should be declared in site specific code.  
//lib_types are 'BP', 'RL', 'partner'

if ( typeof( window[ 'servlet_mlc' ] ) == "undefined" ) {
   var servlet_mlc = '/other/';
}

global_mlc = test_mlc + '/bitpipe' + servlet_mlc;
bp_mlc =  ';' + test_mlc + '/bitpipe/' + lib_type + '/' + site_cd + servlet_mlc;


hbx.acct="DM5212204PCA83EN3;DM550320L1AE83EN3";//global;bitpipe;

if ( typeof( window[ 'lib_type' ] ) == "undefined" ) {
	lib_type = "BP";
}

rl_mlc = "";
if (lib_type == "RL") {
	rl_mlc = bp_mlc;
	hbx.acct += ';' + rl_acct;
} 

//get pagename value
if ( typeof( window[ 'servlet_pn' ] ) == "undefined" ) {
   var servlet_pn = document.location.pathname;
   servlet_pn = servlet_pn.replace(/\/data\/web\/\w+/i, "");
}


//ASRC, PSRC
var expIn2Hr = new Date();
expIn2Hr.setTime(expIn2Hr.getTime() + 1000 * 3600 * 2) // dead in 2 Hr


var args = getArgs();

//Check cookie for asrc first
var asrc = getSrcCookie("ASRC");

if (!asrc || asrc == "") {
	//look for asrc in args
	asrc = args.asrc;
	
	//still no asrc?
	if (!asrc || asrc == "") {
	
	// check search engine referrer and set appropriate ASrc
	// doesn't use code from above as that list isn't up to date, 
	// which would skew stats
  
		var r = document.referrer;
		if (r || r != "") {
			asrc = getReferrerAsrc(r);
		}
	}
} 

var cm1;
if (asrc) {
	var values = asrc.split(/_|-|\|/);
	if (values.length >= 2) {
		cm1 = values[0]+"|"+values[1]+"-"+site_cd+"-";
		if (values.length >= 3)
		    cm1 += values[2];
	  	if (args.res_id)
        	contentId = args.res_id;
        else
        	contentId = servlet_pn;  
        cm1 += "-"+contentId.replace(/-/g,"_");
		setSrcCookie("ASRC", asrc, expIn2Hr, "/");
    }
}


function parsePSRC(psrc) {
	var values = psrc.split(/_|-|\|/);
	if (values.length >= 1) {
		return values[0]+"|"+site_cd;
    } else
    	return null;
}


// placement source life is 3 pages
var psrc;
var cm2;
if (args.psrc) {
	psrc = args.psrc;
	cm2 = parsePSRC(psrc);
	psrc = psrc + "+2"; // will live for 2 more page hits
	setSrcCookie("PSRC", psrc, expIn2Hr, "/");
} else {
	psrc = getSrcCookie("PSRC");
	// if exist decrease the count, if count reaches 0, remove cookie
	if (psrc) {
	    var expdate = new Date();
		expdate.setTime(expdate.getTime() - 1000 * 3600 * 24) // 24 Hr before
		var values = psrc.split("+");
		if (values.length >= 2) {
			if (values[1] > 0) {
				values[1] = parseInt(values[1]) - 1;
				psrc = values[0] + "+" + values[1];
				cm2 = parsePSRC(values[0]);
				setSrcCookie("PSRC", psrc, expIn2Hr, "/");
			} else {
				psrc = null;
				setSrcCookie("PSRC", psrc, expdate, "/");
			}
		} else {
			// something wrong remove psrc from cookie
			psrc = null;
			setSrcCookie("PSRC", psrc, expdate, "/");
		}
	}
}

// store csrc if passed
if (args.csrc) {
    setSrcCookie("CSRC", args.csrc, expIn2Hr, "/");
}


//BEGIN EDITABLE SECTION
//CONFIGURATION VARIABLES
//hbx.acct defined above
hbx.pn=servlet_pn;//PAGE NAME(S)
hbx.mlc=global_mlc + bp_mlc + rl_mlc;//MULTI-LEVEL CONTENT CATEGORY
hbx.pndef="title";//DEFAULT PAGE NAME
hbx.ctdef="full";//DEFAULT CONTENT CATEGORY

//OPTIONAL PAGE VARIABLES
//ACTION SETTINGS
hbx.fv="";//FORM VALIDATION MINIMUM ELEMENTS OR SUBMIT FUNCTION NAME
hbx.lt="auto";//LINK TRACKING
hbx.dlf="n";//DOWNLOAD FILTER
hbx.dft="n";//DOWNLOAD FILE NAMING
hbx.elf="n";//EXIT LINK FILTER

//SEGMENTS AND FUNNELS
hbx.seg=getVisitorSegment();//VISITOR SEGMENTATION
hbx.fnl="";//FUNNELS

//CAMPAIGNS
hbx.cmp="";//CAMPAIGN ID
hbx.cmpn="";//CAMPAIGN ID IN QUERY
hbx.dcmp="";//DYNAMIC CAMPAIGN ID
hbx.dcmpn="";//DYNAMIC CAMPAIGN ID IN QUERY
hbx.dcmpe="";//DYNAMIC CAMPAIGN EXPIRATION
hbx.dcmpre="";//DYNAMIC CAMPAIGN RESPONSE EXPIRATION
hbx.hra="";//RESPONSE ATTRIBUTE
hbx.hqsr="";//RESPONSE ATTRIBUTE IN REFERRAL QUERY
hbx.hqsp="";//RESPONSE ATTRIBUTE IN QUERY
hbx.hlt="";//LEAD TRACKING
hbx.hla="";//LEAD ATTRIBUTE
hbx.gp="";//CAMPAIGN GOAL
hbx.gpn="";//CAMPAIGN GOAL IN QUERY
hbx.hcn="";//CONVERSION ATTRIBUTE
hbx.hcv="";//CONVERSION VALUE
hbx.cp="null";//LEGACY CAMPAIGN
hbx.cpd="";//CAMPAIGN DOMAIN

//CUSTOM VARIABLES
hbx.ci="";//CUSTOMER ID

if(cm1) hbx.hc1=cm1;
else hbx.hc1="";
if(cm2) hbx.hc2=cm2;
else hbx.hc2="";

hbx.hc3="";//CUSTOM 3
hbx.hc4="";//CUSTOM 4
hbx.hrf="";//CUSTOM REFERRER
var cv=_hbEvent("cv");
cv.c7=( typeof( window[ 'bizcard_cm' ] ) == "undefined" ) ? "" : bizcard_cm;

//INSERT CUSTOM EVENTS


// setting custom event for search
if ( typeof(window['servlet_search_keyword']) != "undefined" ) {
	var sev = _hbEvent("search");
	sev.keywords = servlet_search_keyword;
	if ( typeof(window['servlet_search_results']) != "undefined" ) {
		sev.results = servlet_search_results;
	} else {
		sev.results = "0";
	}
}

var ref = document.referrer;

//Keep this code.  Used for testing.
if (document.cookie.indexOf("wrData=on") != -1) {
  if(typeof tt_alert == "undefined") var tt_alert = "";
  tt_alert = "HITBOX DATA \n";
  tt_alert += "account numbers = " + hbx.acct + "\n";  
  tt_alert += "multi-level content (hbx.mlc) = " + hbx.mlc + "\n";
  tt_alert += "pagename (hbx.pn) = " + hbx.pn + "\n";
  tt_alert += "visitor segment (hbx.seg) = " + hbx.seg + "\n";
  tt_alert += "arival source (hbx.hc1) = " + hbx.hc1 + "\n";
  tt_alert += "placement source (hbx.hc2) = " + hbx.hc2 + "\n";
  tt_alert += "custom metric 7 = " + cv.c7  + "\n";
  r = document.referrer;
  domain = document.domain;
  tt_alert += "referrer = " +  r + "\n";
  tt_alert += "domain = " + domain + "\n";
  tt_alert += domain.indexOf(r)
  if (tt_alert != "") window.alert(tt_alert);
}

//END EDITABLE SECTION

//REQUIRED SECTION. CHANGE "YOURSERVER" TO VALID LOCATION ON YOUR WEB SERVER (HTTPS IF FROM SECURE SERVER)

<!--END WEBSIDESTORY CODE-->
