<!-- extra webtrends tracking code -->


// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(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));
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

//this sets the location on the page the link came from
function jump(loc)
{
	if (loc != null)
	{
		setCookie("locOnPage", loc,"","/",".mlb.com");
	}

}

//rewrite the current url to include cookie info
function rewriteURL()
{

	var whereFrom = getCookie("whereFrom");
	var sectionFrom = getCookie("locOnPage");



	var cur_url = document.URL;
	var found = cur_url.indexOf("?");
	var addedparam = false;
	if (whereFrom != null)
	{
		if (found == -1)
		{
			cur_url = cur_url + "?whereFrom=" + whereFrom;
		}
		else
		{
			cur_url = cur_url + "&whereFrom=" + whereFrom;
		}
		addedparam = true;
		//if_sourceNav = "&whereFrom=" + whereFrom; //added for Insight first
	}
	if (sectionFrom != null)
	{
		if ((found == -1) && (addedparam != true))
		{
			cur_url = cur_url + "?sectionFrom=" + sectionFrom;
		}
		else
		{
			cur_url = cur_url + "&sectionFrom=" + sectionFrom;
		}
		if_sourceNav = if_sourceNav + "&sectionFrom=" + sectionFrom; //added for Insight first
	}

	var page = document.URL;
	page = page.toLowerCase();
	var pathstart = page.indexOf("/nasapp/mlb") + 12;
	if (pathstart != 11)
	{
		page = page.slice(pathstart);
	}
	setCookie("whereFrom", page,"","/",".mlb.com");
	deleteCookie("locOnPage","/",".mlb.com");
	return(cur_url);

}
//function that tracks popups, parameters are (destination URL, tracking id, popup window name, window width, window height, scroll bar (yes/no), resizable (yes, no), toolbar (yes, no))
function click_through_popup(url,id,winName,w,h,scrBar,reSize,tBar)
{
    var SITEID2 = "90316";
    var SID2 = "005-01-7-18-254547-90316";	
    	wtl_Tag6(SITEID2,SID2,wtl_url,wtl_title,id);
    	wtl_Tag6(MLBAMSITEID,MLBAMSID,wtl_url,wtl_title,'ad,'+id);	
	test = url;
	if (winName=="") {
	setTimeout(document.location.href=url,500);
	} else {
	winAttributes = "width="+w+",height="+h+",scrollbars="+scrBar+",resizable="+reSize+",toolbar="+tBar;
	setTimeout(window.open(url,winName,winAttributes),500);
	}
}

function click_through(url,id) {
	click_through_popup(url,id,"","","","","","");
}

<!-- end extra webtrends tracking code -->
var wtl_imgarray = new Array;
var wtl_ptr = 0;
function wtl_Tag6(wtl_TagID,wtl_SID,wtl_URL,wtl_Title,CONTENTGROUP)
{

    function wtl_createImage(wtl_src)
    {
        wtl_imgarray[wtl_ptr] = new Image;
        wtl_imgarray[wtl_ptr].src = wtl_src;
        wtl_ptr++;
    }

    function D8( d)
    {
        var fwd=1, seed= new Date('01/01/2000'), key= "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
        var s= key.charAt( d.getFullYear()-2000)+key.charAt( d.getMonth()+1)+key.charAt( d.getDate());
        s+= key.charAt( d.getHours())+key.charAt( d.getMinutes())+key.charAt( d.getSeconds());
        while( seed.getDay()!=fwd) seed= new Date(seed.getTime() + 86400000);
        var w= Math.floor( (d.getTime()-(seed.getTime()+86400000)) / 604800000 );
        s+= key.charAt( (w-(w%16))/16 );
        s+= key.charAt( w%16);
        return s;
    }

    function A( B, C)
    {
        W+="&"+B+"="+escape(C);
    }

    var t = new Date();
    var W="http"+(document.URL.indexOf('https:')==0?'s':'')+"://statse.webtrendslive.com/S" + wtl_SID + "/button6.asp?tagver=" + wtl_TagVer + "&si=" + wtl_TagID + "&offset=" + wtl_Offset + "&fw=" + wtl_FWD;
    A( "server", typeof(SERVER)== "string" ? SERVER : "");
    A( "order", typeof(ORDER)== "string" ? ORDER : "");
    A( "Group", typeof(CONTENTGROUP)== "string" ? CONTENTGROUP : "");
    A( "invoice", typeof(INVOICE)== "string" ? INVOICE : "");
    A( "cartview", typeof(CARTVIEW)== "string" ? CARTVIEW : "");
    A( "cartadd", typeof(CARTADD)== "string" ? CARTADD : "");
    A( "cartremove", typeof(CARTREMOVE)== "string" ? CARTREMOVE : "");
    A( "checkout", typeof(CHECKOUT)== "string" ? CHECKOUT : "");
    A( "cartbuy", typeof(CARTBUY)== "string" ? CARTBUY : "");
    A( "adcampaign", typeof(ADCAMPAIGN)== "string" ? ADCAMPAIGN : "");
    A( "tz", t.getTimezoneOffset());
    A( "ch", t.getHours());
    A( "cl", D8(t));
    A( "ti", wtl_Title);
    A( "url", wtl_URL);
    A( "rf", window.document.referrer);
    A( "js", "Yes");
    A( "ul", navigator.appName=="Netscape" ? navigator.language : navigator.userLanguage);
    if(typeof(screen)=="object")
    {
    A( "sr", screen.width+"x"+screen.height);
    A( "cd", screen.colorDepth);
    A( "jo", navigator.javaEnabled() ? "Yes" : "No");
    }

    if( W.length>2048 && navigator.userAgent.indexOf('MSIE')>=0)
        W= W.substring( 0, 2043)+"&tu=1";

    wtl_createImage(W);
	
}
    var if_sourceNav = ""; //added for IF
    var wtl_TagVer = 6;
    var wtl_FWD = 0;
    var wtl_Offset = "0";
    WTL_TAG = new Image;
    WTL_TAG.ID = "WTL_TAG";
    var wtl_url = rewriteURL();
    var wtl_title = document.title;
    var test = "test";

