﻿//temp file for AB Testing the Bizbox links.
//Adds event listeners and handlers for capturing clicks
//called from common/SharedTemplates.xsl and js/slate_js_main_2008.js

var BizboxTest = {};

BizboxTest.anc;//anchor to which we add an event listener
BizboxTest.placement;//which placement this is
BizboxTest.loc;//location...either 'homepage' or 'other'
BizboxTest.url;//bizbox location

BizboxTest.enableAjaxLinks = function(a,p,u,execute)
{
	BizboxTest.anc = a;
	BizboxTest.placement = p;
	BizboxTest.url = u;
	BizboxTest.loc = (window.commercialNode == "homepage")? "homepage" : "other";
	
	if(execute)
	{
		BizboxTest.sendStats();
	}
	else
	{
	SlateDom.addListener(BizboxTest.anc,"click",BizboxTest.sendStats);
}
}

BizboxTest.sendStats = function(evt)
{
	ABTesting.sendStats(3, "Bizbox", BizboxTest.placement + "|" + BizboxTest.loc);
	window.location.assign(BizboxTest.url);	
}

