//--------------------------------------------------------------------------
// only one eVar to set to id test so we can only initiate one test on a 
// page at a time. If the reporting can support it we may be able to put a list 
// of groups in eVar40: s_omtr.eVar40 += testName+"-_-"+group+"|";
//--------------------------------------------------------------------------
function ABTest(testName, alloc) {
	this.getGroup = function(id) {
		var base=0;
		for(var i=0; i< alloc.length; i++) {
			base +=alloc[i];
			if (id < base) {
				break;
			}
		}
		return String.fromCharCode(65+i);
	}
	var forcedGroup = getQueryVariable(testName);
	if (getCookie("kiosk") != "") forcedGroup = "A";
	if (forcedGroup != "" && forcedGroup.match(/^[A-Z]$/) != null) {
		setCookie(testName,forcedGroup,30);
	}
	try {
		var group = getCookie(testName);
		if((group == null || group.match(/^[A-Z]$/) == null)){
			group = getGroup(new Date().getMilliseconds()%100);
			setCookie(testName,group,30);
			s_omtr.eVar40=testName+"-_-"+group;
		} 
		$("head").append("<link rel='stylesheet' type='text/css' href='/flydowns/"+testName+"-_-"+group+".css'>");
	}catch(e){/*alert("error:"+e);*/}  
	return group;
}

//-------------------------------------------------------------------------- 
// testName will be used for cookieName, omniture evar40, and css 
// (ex. "AB061209-_-FSBannerTest-_-A.css") file to use for each test
// allocation elements should add up to 100%, first position is A group 
// allocation, second B group, etc
ABTest("AB021210-_-SWT",[33.33,33.33,33.33]);



