loadPersonaCookie(); // sets omniture id

// if source id (campaign), set referrer cookie to track on login too
if(s_ea.getQueryParam('sourceid'))
{
	// set referral cookie that lasts 30 days
	var days = 30;
	var date = new Date();
	date.setTime(date.getTime()+(days*24*60*60*1000));
    setCookie ( 'TWOCookie[REFERRER]', encode64 ( s_ea.getQueryParam('sourceid') ), date.toGMTString());
}

/* You may give each page an identifying name, server, and channel on
the next lines. */
s_ea.pageName="NA:US:SPORTS:TIBURON:ONLINEGAME:TIGER:TIGERONLINE:TIGERONLINE:" + getOmnitureSubState() + omniturePageTitle

s_ea.server="" //Used by EMEA as site section but should be moved to channel
s_ea.channel=""//used to identify site and section in some instances
s_ea.pageType=""//Only used for error pages (404s etc.)
s_ea.prop1=omnitureId
s_ea.prop2="TIGERONLINE"
s_ea.prop3="SPORTS"
s_ea.prop4="TIGER"
s_ea.prop5="TIGERONLINE"
s_ea.prop6="PC"
s_ea.prop7="TIBURON"
s_ea.prop9="ONLINEGAME"
s_ea.prop10=pageTitle
s_ea.prop11="NA"
s_ea.prop12="en_US"
s_ea.prop15=omnitureContentBucket
s_ea.prop17="US"
s_ea.prop18="US:TIGERONLINE"

/* E-commerce Variables */
s_ea.eVar1=omnitureId
s_ea.eVar3="TIGERONLINE"//Same as prop5
s_ea.eVar17="US"//Same as prop 17
s_ea.eVar18="NA"//Same as prop 11
s_ea.eVar29=s_ea.setInitValOnce('US:TIGERONLINE:TIGERONLINE');
s_ea.eVar30="US:TIGERONLINE:TIGERONLINE"
s_ea.eVar34="SPORTS"

/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
if((s_imageDisableFlag == null) || (typeof (s_imageDisableFlag) == 'undefined') || (!s_imageDisableFlag))
{
	var s_code=s_ea.t();
	if(s_code)
	{
		document.write(s_code)
	}
}

function getOmnitureSubState()
{
	var state = '??';
	var authCookie = getCookie("CEM-login");
	if(authCookie==null || authCookie=="")
	{
		// not logged in
		state = 'GT';
	}
	else
	{
		// dev boxes
		if (ignoreSubscriptions)
		{
			state = 'EA';
		}
		else
		{
			var subscriptionType = unescape(getCookie("TWOCookie[SUBSCRIPTION]"));
			// ea employee
			if(subscriptionType == "tigerUnlimited")
			{
				state = 'EA';
			}
			// monhtly or annual subscriber
			else if(subscriptionType == "subscription")
			{
				state = 'SB';
			}
			// non-subscriber, free player, pay per round...
			else
			{
				state = 'FR';
			}
		}
	}
	return state;
}

function tagInOmniture(tag)
{
	if(s_ea != undefined)
	{
		s_ea.pageName="NA:US:SPORTS:TIBURON:ONLINEGAME:TIGER:TIGERONLINE:TIGERONLINE:" + getOmnitureSubState() + tag;
		
		if((s_imageDisableFlag == null) || (typeof (s_imageDisableFlag) == 'undefined') || (!s_imageDisableFlag))
		{
			var s_code=s_ea.t();
			if(s_code)
			{
				document.write(s_code)
			}
		}
	}	
}

