document.domain="mlb.com";

// identifies this page to omniture as one of our pages (as opposed 
// to a partner page; we use this for tracking the sales process):
var s_eVar16="mlb";

// sniff
var isWin = window.navigator.platform.toLowerCase().indexOf('win') != -1 ? 1:0;
var isMac = window.navigator.platform.toLowerCase().indexOf('mac') != -1 ? 1:0;
var isDOM = document.getElementById ? 1:0;
var isIE = document.all ? 1:0;
var isIE4 = isIE && !isDOM ? 1:0;
var isIE5 = isIE && isDOM ? 1:0;
var isNS = navigator.appName=='Netscape';
var isNS4 = isNS && !isDOM ? 1:0;
var isNS6 = isNS && isDOM ? 1:0;
var isOp = window.opera ? 1:0;
var isDyn = isDOM||isIE||isNS4;

var dq = "";
var agt= navigator.userAgent.toLowerCase();
var is_nav = ((agt.indexOf('spoofer') > -1) || (agt.indexOf('webtv') > -1) || (agt.indexOf('hotjava') > -1));
if (!is_nav) {
	if ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1)) { dq += "&os=win95"; }
	else if (agt.indexOf("mac")!=-1) { dq += "&os=mac";}
	else { dq += "&os=winX";}
} else { dq += "&os=other";}
dq += ((isIE) ? "&browser=IE" : "&browser=nonIE");

//domain
var matchFound=false;
var fcCookieData=["4,7,2","6,3,5","rD12MlmydnovtuVwx6ghSs","u,.?d78wagklD9efHTn/1XvY","kLYZ4IJaiT8N.-_QRbcHKPEF","`~!@+o#$bZE]|:;<>34mF={","}[&*GcV()_-st5%^U2W0","j90:/W3zABCU5pG7XOefq","c89wqZK.@+8Ai2k(m+@","4,3,8","0,9,l","d89#JXY89~;d=_aQn6@S|{"];
var _x=["8Z+2.Z.v88c:KwZ(cZ+t..+$.qZ#@qZ2Zq9tKw8W++8]8cZ$","wc.ZZq8v@88|Z.Z8cw@+9qZtq@w$qqZ#8cK2@wwt.q9Wc+8]qcZ$","9cKZw9@vZ..|8+q8K9+@.KqtZ98$q.8#w.@2@8.twq+W88K]+@+$","Zq8@@cZ89ZqtcqZ+q+8t9+84+.@t8cc4@8+-",".cc@9Z@8Zq.t@9c+c++t@.84@q+tZwq4+cK/",
		"8KcE9qqv+Z+>wcZZ.K8v9q8|wcw89@w+c9.t.@.$@Kq#8.K28+qtq++WKc+]qK8$","8qZ`+qZ(@+@|8Kc)8@@T88ct@Zc$w++#ZK+2Z+ctqq@W9@K]wZ9$", "cZc{K8qv9.9W9c+;+cK~K@Kvq8qt8+9`q9Z(w8Z|c.8)Zw8Tc+ctKK+$c8Z#q8Z2Z9ct.ZcW.w8]+9w$"];
for (var i=0; i<_x.length; i++) {
	var fcmode=getFCModeHref(_x[i]);
	if (location.href.indexOf(fcmode)>-1) { matchFound=true; }
}

function markFC(primary, s1, s2) {
	var fcOp=999;
	if (primary.length+fcOp==s1+s2) { return 0; }
	else if (s1==s2+fcOp) { return -1; }
	return parseInt(primary[s1].charAt(s2));
}
function getFCModeHref(locHref) {
	var fcMarkOkChars=fcCookieData[markFC(fcCookieData, 0, 0)]+fcCookieData[markFC(fcCookieData, 0, 2)]+fcCookieData[markFC(fcCookieData, 0, 4)];
	var fcOffset=parseInt(fcCookieData[9].charAt(0))-parseInt(fcCookieData[10].charAt(0));
	var fcModeRewrite=fcCookieData[markFC(fcCookieData, 1, 0)]+fcCookieData[markFC(fcCookieData, 1, 2)]+fcCookieData[markFC(fcCookieData, 1, 4)];
	var targetHrefParam="";
	for (var i=fcOffset-1; i<locHref.length; i+=fcOffset) {
		targetHrefParam+=fcMarkOkChars.charAt(fcModeRewrite.indexOf(locHref.charAt(i)));
	}
	return targetHrefParam;
}
function openTIXXWindow(url,loc) {
	var thisURL = "/components/global/ticketing_redirect.html?jumpTo="+escape(url)+"&loc="+loc;
	popWin(thisURL,'Tickets','800','550','dependent,status,scrollbars,titlebar,resizable');
}
function openNonTIXXWindow(url,loc) {
	var thisURL = "/components/global/ticketing_redirect.html?jumpTo="+escape(url)+"&loc="+loc;
	popWin(thisURL,'Tickets','800','550','dependent,status,scrollbars,titlebar,resizable,location,toolbar,menubar');
}
// gameday04
function launchGameday(params) {
	var gamedayURL = 'http://mlb.mlb.com/mlb/gameday/gd2005.html?' + params;
	popWin(gamedayURL,'GamedayWin','770','600','location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes');
}
// append stc to url
function appendSTC(page) { 
	var ran_unrounded = Math.random() * 1000000000;
	var ran_number = Math.round(ran_unrounded);
	if ( page.indexOf("?") == -1 ) window.location.href = page + "?stc=" + ran_number;
	else window.location.href = page + "&stc=" + ran_number;
}
function includeJS(){
	if(arguments.length>0) INCLUDE=arguments;
	if(typeof INCLUDE!="undefined"){
		for(var i=0;i<INCLUDE.length;i++){
			document.writeln("<scr"+"ipt src='/scripts/"+INCLUDE[i]+".js' type='text/javascript'></scr"+"ipt>");
		}
	}
}
// cookie, tracking, util and media player scripts
includeJS("util", "cookie","global_tracking", "playMedia");

