var standings_rs_alc = [{
	w: '0',
	elim: '-',
	rs: '0',
	div: 'alc',
	gameid: '2009_04_06_kcamlb_chamlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v KC',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'cws',
	pct: '-',
	league_sensitive_team_name: 'Chi White Sox',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Chicago',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'alc',
	gameid: '2009_04_06_clemlb_texmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ TEX,  2:05P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'cle',
	pct: '-',
	league_sensitive_team_name: 'Cleveland',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Cleveland',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'alc',
	gameid: '2009_04_06_detmlb_tormlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ TOR,  7:15P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'det',
	pct: '-',
	league_sensitive_team_name: 'Detroit',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Detroit',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'alc',
	gameid: '2009_04_06_kcamlb_chamlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ CWS',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'kc',
	pct: '-',
	league_sensitive_team_name: 'Kansas City',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Kansas City',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'alc',
	gameid: '2009_04_06_seamlb_minmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v SEA,  8:10P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'min',
	pct: '-',
	league_sensitive_team_name: 'Minnesota',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Minnesota',
	road: '0-0'
}]
var standings_rs_ale = [{
	w: '0',
	elim: '-',
	rs: '0',
	div: 'ale',
	gameid: '2009_04_06_nyamlb_balmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v NYY,  3:05P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'bal',
	pct: '-',
	league_sensitive_team_name: 'Baltimore',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Baltimore',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'ale',
	gameid: '2009_04_06_tbamlb_bosmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v TB,  2:05P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'bos',
	pct: '-',
	league_sensitive_team_name: 'Boston',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Boston',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'ale',
	gameid: '2009_04_06_nyamlb_balmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ BAL,  3:05P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'nyy',
	pct: '-',
	league_sensitive_team_name: 'NY Yankees',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'New York',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'ale',
	gameid: '2009_04_06_tbamlb_bosmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ BOS,  2:05P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'tb',
	pct: '-',
	league_sensitive_team_name: 'Tampa Bay',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Tampa Bay',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'ale',
	gameid: '2009_04_06_detmlb_tormlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v DET,  7:15P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'tor',
	pct: '-',
	league_sensitive_team_name: 'Toronto',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Toronto',
	road: '0-0'
}]
var standings_rs_alw = [{
	w: '0',
	elim: '-',
	rs: '0',
	div: 'alw',
	gameid: '2009_04_06_oakmlb_anamlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v OAK,  9:05P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'ana',
	pct: '-',
	league_sensitive_team_name: 'LA Angels',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Los Angeles',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'alw',
	gameid: '2009_04_06_oakmlb_anamlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ LAA,  9:05P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'oak',
	pct: '-',
	league_sensitive_team_name: 'Oakland',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Oakland',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'alw',
	gameid: '2009_04_06_seamlb_minmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ MIN,  8:10P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'sea',
	pct: '-',
	league_sensitive_team_name: 'Seattle',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Seattle',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'alw',
	gameid: '2009_04_06_clemlb_texmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v CLE,  2:05P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'tex',
	pct: '-',
	league_sensitive_team_name: 'Texas',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Texas',
	road: '0-0'
}]
var standings_rs_nlc = [{
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nlc',
	gameid: '2009_04_06_chnmlb_houmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ HOU',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'chc',
	pct: '-',
	league_sensitive_team_name: 'Chi Cubs',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Chicago',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nlc',
	gameid: '2009_04_06_nynmlb_cinmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v NYM,  1:10P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'cin',
	pct: '-',
	league_sensitive_team_name: 'Cincinnati',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Cincinnati',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nlc',
	gameid: '2009_04_06_chnmlb_houmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v CHC',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'hou',
	pct: '-',
	league_sensitive_team_name: 'Houston',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Houston',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nlc',
	gameid: '2009_04_07_milmlb_sfnmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/7 @ SF,  4:05P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'mil',
	pct: '-',
	league_sensitive_team_name: 'Milwaukee',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Milwaukee',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nlc',
	gameid: '2009_04_06_pitmlb_slnmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ STL,  4:15P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'pit',
	pct: '-',
	league_sensitive_team_name: 'Pittsburgh',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Pittsburgh',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nlc',
	gameid: '2009_04_06_pitmlb_slnmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v PIT,  4:15P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'stl',
	pct: '-',
	league_sensitive_team_name: 'St. Louis',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'St. Louis',
	road: '0-0'
}]
var standings_rs_nle = [{
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nle',
	gameid: '2009_04_05_atlmlb_phimlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/5 @ PHI,  8:00P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'atl',
	pct: '-',
	league_sensitive_team_name: 'Atlanta',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Atlanta',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nle',
	gameid: '2009_04_06_wasmlb_flomlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v WSH',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'fla',
	pct: '-',
	league_sensitive_team_name: 'Florida',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Florida',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nle',
	gameid: '2009_04_06_nynmlb_cinmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ CIN,  1:10P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'nym',
	pct: '-',
	league_sensitive_team_name: 'NY Mets',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'New York',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nle',
	gameid: '2009_04_05_atlmlb_phimlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/5 v ATL,  8:00P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'phi',
	pct: '-',
	league_sensitive_team_name: 'Philadelphia',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Philadelphia',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nle',
	gameid: '2009_04_06_wasmlb_flomlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ FLA',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'was',
	pct: '-',
	league_sensitive_team_name: 'Washington',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Washington',
	road: '0-0'
}]
var standings_rs_nlw = [{
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nlw',
	gameid: '2009_04_06_colmlb_arimlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v COL,  3:40P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'ari',
	pct: '-',
	league_sensitive_team_name: 'Arizona',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Arizona',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nlw',
	gameid: '2009_04_06_colmlb_arimlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ ARI,  3:40P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'col',
	pct: '-',
	league_sensitive_team_name: 'Colorado',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Colorado',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nlw',
	gameid: '2009_04_06_lanmlb_sdnmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 @ SD,  7:05P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'la',
	pct: '-',
	league_sensitive_team_name: 'LA Dodgers',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'Los Angeles',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nlw',
	gameid: '2009_04_06_lanmlb_sdnmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/6 v LAD,  7:05P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'sd',
	pct: '-',
	league_sensitive_team_name: 'San Diego',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'San Diego',
	road: '0-0'
}, {
	w: '0',
	elim: '-',
	rs: '0',
	div: 'nlw',
	gameid: '2009_04_07_milmlb_sfnmlb_1',
	status: 'P',
	pre: null,
	last10: '0-0',
	onerun: '0-0',
	xtr: '0-0',
	nextg: '4/7 v MIL,  4:05P',
	vsW: '0-0',
	ra: '0',
	gb: '-',
	wrap: null,
	home: '0-0',
	code: 'sf',
	pct: '-',
	league_sensitive_team_name: 'San Francisco',
	vsC: '0-0',
	vsE: '0-0',
	clinch: '',
	vsR: '-',
	vsL: '-',
	xwl: '0-0',
	strk: '-',
	l: '0',
	lastg: null,
	interleague: '0-0',
	team: 'San Francisco',
	road: '0-0'
}]
/**
 * @desc function star_mlb_standings()
 * The function star_mlb_standings() builds a small table of current standings
 *   and outputs it as a table inside the given html object.
 *
 * @param string division
 * @param string team
 */
function star_mlb_standings() {
	// Deal with any passed arguments.
	if (arguments[0] != null && arguments[0] != 'undefined' && in_array(arguments[0], ["alc","ale","alw","nlc","nle","nlw"])) {
		star_mlb_options['division']	= arguments[0];
	}
	if (arguments[1] != null && arguments[1] != 'undefined' && in_array(arguments[1], ["oak","ana","hou","tor","atl","mil","stl","chc","tb","ari","la","sf","cle","sea","fla","nym","was","bal","sd","phi","pit","tex","cin","bos","col","kc","det","min","cws","nyy"])) {
		star_mlb_options['team']		= arguments[1];
	}

	// Build team mascots array.
	var mascots	= new Object;
	mascots['oak']	= 'A\'s';
	mascots['ana']	= 'Angels';
	mascots['hou']	= 'Astros';
	mascots['tor']	= 'Blue Jays';
	mascots['atl']	= 'Braves';
	mascots['mil']	= 'Brewers';
	mascots['stl']	= 'Cardinals';
	mascots['chc']	= 'Cubs';
	mascots['tb']	= 'Devil Rays';
	mascots['ari']	= 'Diamondbacks';
	mascots['la']	= 'Dodgers';
	mascots['sf']	= 'Giants';
	mascots['cle']	= 'Indians';
	mascots['sea']	= 'Mariners';
	mascots['fla']	= 'Marlins';
	mascots['nym']	= 'Mets';
	mascots['was']	= 'Nationals';
	mascots['bal']	= 'Orioles';
	mascots['sd']	= 'Padres';
	mascots['phi']	= 'Phillies';
	mascots['pit']	= 'Pirates';
	mascots['tex']	= 'Rangers';
	mascots['cin']	= 'Reds';
	mascots['bos']	= 'Red Sox';
	mascots['col']	= 'Rockies';
	mascots['kc']	= 'Royals';
	mascots['det']	= 'Tigers';
	mascots['min']	= 'Twins';
	mascots['cws']	= 'White Sox';
	mascots['nyy']	= 'Yankees';

	// Get the object to contain the standings content.
	var standingsBody	= document.getElementById('star_mlb_standings_body');
	var standingsMagicNum	= document.getElementById('star_mlb_magic_number');

	// Get the object to contain the standings head.
	var standingsHead	= document.getElementById('star_mlb_standings_head');

	// Get the variable that contains the current standings and the head.
	var standings_rs	= '';
	var standings_head	= '';

	// Deal with the division.
	var division	= star_mlb_options['division'];
	if (division == null || division == 'undefined') {
		division	= 'nlc';
	}

	// Deal with the team.
	var team		= star_mlb_options['team'];

	switch (division) {
		// American League East.
		case 'ale':
			standings_rs	= eval('standings_rs_' + division);
			standings_head	= '<acronym title="American League">AL</acronym> East';
		break;

		// American League Central.
		case 'alc':
			standings_rs	= eval('standings_rs_' + division);
			standings_head	= '<acronym title="American League">AL</acronym> Central';
		break;

		// American League West.
		case 'alw':
			standings_rs	= eval('standings_rs_' + division);
			standings_head	= '<acronym title="American League">AL</acronym> West';
		break;

		// National League East.
		case 'nle':
			standings_rs	= eval('standings_rs_' + division);
			standings_head	= '<acronym title="National League">NL</acronym> East';
		break;

		// National League West.
		case 'nlw':
			standings_rs	= eval('standings_rs_' + division);
			standings_head	= '<acronym title="National League">NL</acronym> West';
		break;

		// National League Central.
		case 'nlc':
		default:
			standings_rs	= eval('standings_rs_' + division);
			standings_head	= '<acronym title="National League">NL</acronym> Central';
		break;
	}

	// Build the links.
	var standings	= '<div class="center">';
	if (division == 'alw') {
		standings	+= '<acronym title="American League West">ALW</acronym>\n';
	} else {
		standings	+= '<a href="javascript:star_mlb_standings(\'alw\');"><acronym title="American League West">ALW</acronym></a>\n';
	}
	if (division == 'alc') {
		standings	+= '<acronym title="American League Central">ALC</acronym>\n';
	} else {
		standings	+= '<a href="javascript:star_mlb_standings(\'alc\');"><acronym title="American League Central">ALC</acronym></a>\n';
	}
	if (division == 'ale') {
		standings	+= '<acronym title="American League East">ALE</acronym>\n';
	} else {
		standings	+= '<a href="javascript:star_mlb_standings(\'ale\');"><acronym title="American League East">ALE</acronym></a>\n';
	}
	if (division == 'nlw') {
		standings	+= '<acronym title="National League West">NLW</acronym>\n';
	} else {
		standings	+= '<a href="javascript:star_mlb_standings(\'nlw\');"><acronym title="National League West">NLW</acronym></a>\n';
	}
	if (division == 'nlc') {
		standings	+= '<acronym title="National League Central">NLC</acronym>\n';
	} else {
		standings	+= '<a href="javascript:star_mlb_standings(\'nlc\');"><acronym title="National League Central">NLC</acronym></a>\n';
	}
	if (division == 'nle') {
		standings	+= '<acronym title="National League East">NLE</acronym>\n';
	} else {
		standings	+= '<a href="javascript:star_mlb_standings(\'nle\');"><acronym title="National League East">NLE</acronym></a><br />\n';
	}
	standings	+= '</div>';

	// Start the standings table.
	standings		+= '<table class="ruler"><thead><tr><th>Team</th><th><acronym title="Wins">W</acronym></th><th><acronym title="Losses">L</acronym></th><th><acronym title="Winning Percentage">Pct.</acronym></th><th><acronym title="Games Back">GB</acronym></th></tr></thead><tbody>';

	// Iterate through each of the teams, displaying their data.
	var magicNumber = 163;
	var firstPlaceTeam;
	for (i = 0; i < standings_rs.length; i++) {
		// Bold the selected team.
		if( i == 0 ) {
		  magicNumber -= standings_rs[i].w;
		  firstPlaceTeam = standings_rs[i].league_sensitive_team_name;
		} else if( i == 1 ) {
		  magicNumber -= standings_rs[i].l;
		}
 
		if (standings_rs[i].code == team) {
			standings_rs[i].league_sensitive_team_name	= standings_rs[i].league_sensitive_team_name;
		}

		// Check URL for last game wrap.
		if (standings_rs[i].wrap != null) {
			var url	= '<a href="http://mlb.mlb.com/news/boxscore.jsp?gid=' + standings_rs[i].gameid + '" title="Last game: ' + standings_rs[i].lastg + '">' + standings_rs[i].league_sensitive_team_name + '</a>';
		} else {
			var url	= '<span title="Last game: ' + standings_rs[i].lastg + '">' + standings_rs[i].league_sensitive_team_name + '</span>';
		}
		standings	+= '<tr>';
		standings	+= '<td>' + url + '</td>';
		standings	+= '<td>' + standings_rs[i].w + '</td>';
		standings	+= '<td>' + standings_rs[i].l + '</td>';
		standings	+= '<td>' + standings_rs[i].pct + '</td>';
		standings	+= '<td>' + standings_rs[i].gb + '</td>';
		standings	+= '</tr>';
	}
	// Close the table.
	standings	+= '</tbody></table>';

	// Include a link to full standings.
	standings	+= '<a class="bold" href="http://mlb.mlb.com/mlb/standings/index.jsp">Expanded Standings</a>';

	// Set the standings object to the standings table.
	if( magicNumber > 0 )
    {
	    standingsMagicNum.innerHTML = firstPlaceTeam+' Magic Number: '+magicNumber;
    }
    else
    {
        standingsMagicNum.innerHTML = firstPlaceTeam+' Division Champs!!';
    }

	standingsBody.innerHTML	= standings;
	standingsHead.innerHTML	= standings_head;
	if (typeof(tableruler) == 'function') {
		tableruler();
	}
}

function in_array(needle, haystack, strict) {
	// http://kevin.vanzonneveld.net
	// +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// *     example 1: in_array('van', ['Kevin', 'van', 'Zonneveld']);
	// *     returns 1: true

	var found = false, key, strict = !!strict;

	for (key in haystack) {
		if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
			found	= true;
			break;
		}
	}

	return found;
}

function addLoadEvent(func) {
	var oldonload	= window.onload;
	if (typeof window.onload != 'function') {
		window.onload	= func;
	} else {
		window.onload	= function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}

var star_mlb_options = new Object;
star_mlb_options['division']	= 'nlw';
star_mlb_options['team']		= 'la';
addLoadEvent(star_mlb_standings);
