	var standings_rs_alc =
[{
	"w": "95",
	"elim": "-",
	"rs": "787",
	"div": "alc",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "7-3",
	"onerun": "29-17",
	"xtr": "6-3",
	"nextg": null,
	"vsW": "18-18",
	"ra": "711",
	"gb": "-",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_10_15_detmlb_texmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": null,
	"home": "50-31",
	"code": "det",
	"pct": ".586",
	"league_sensitive_team_name": "Detroit",
	"vsC": "50-22",
	"vsE": "20-16",
	"clinch": "y",
	"vsL": "31-20",
	"vsR": "64-47",
	"xwl": "88-74",
	"l": "67",
	"strk": "W4",
	"lastg": "10/15 @ TEX, L 5-15",
	"interleague": "7-11",
	"road": "45-36",
	"games_back_wildcard": null,
	"team": "Detroit"
}, {
	"w": "80",
	"elim": "E",
	"rs": "704",
	"div": "alc",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "4-6",
	"onerun": "30-26",
	"xtr": "6-8",
	"nextg": null,
	"vsW": "14-21",
	"ra": "760",
	"gb": "15.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_clemlb_detmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "44-37",
	"code": "cle",
	"pct": ".494",
	"league_sensitive_team_name": "Cleveland",
	"vsC": "36-36",
	"vsE": "19-18",
	"clinch": null,
	"vsL": "23-26",
	"vsR": "57-56",
	"xwl": "75-87",
	"l": "82",
	"strk": "L4",
	"lastg": "9/28 @ DET, L 4-5",
	"interleague": "11-7",
	"road": "36-45",
	"games_back_wildcard": "11.0",
	"team": "Cleveland"
}, {
	"w": "79",
	"elim": "E",
	"rs": "654",
	"div": "alc",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "5-5",
	"onerun": "24-25",
	"xtr": "7-11",
	"nextg": null,
	"vsW": "19-16",
	"ra": "706",
	"gb": "16.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_tormlb_chamlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "36-45",
	"code": "cws",
	"pct": ".488",
	"league_sensitive_team_name": "Chi White Sox",
	"vsC": "32-40",
	"vsE": "17-20",
	"clinch": null,
	"vsL": "24-22",
	"vsR": "55-61",
	"xwl": "75-87",
	"l": "83",
	"strk": "L1",
	"lastg": "9/28 vs TOR, L 2-3",
	"interleague": "11-7",
	"road": "43-38",
	"games_back_wildcard": "12.0",
	"team": "Chicago"
}, {
	"w": "71",
	"elim": "E",
	"rs": "730",
	"div": "alc",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "5-5",
	"onerun": "25-32",
	"xtr": "10-8",
	"nextg": null,
	"vsW": "18-17",
	"ra": "762",
	"gb": "24.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_kcamlb_minmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "40-41",
	"code": "kc",
	"pct": ".438",
	"league_sensitive_team_name": "Kansas City",
	"vsC": "32-40",
	"vsE": "16-21",
	"clinch": null,
	"vsL": "16-26",
	"vsR": "55-65",
	"xwl": "78-84",
	"l": "91",
	"strk": "L2",
	"lastg": "9/28 @ MIN, L 0-1",
	"interleague": "5-13",
	"road": "31-50",
	"games_back_wildcard": "20.0",
	"team": "Kansas City"
}, {
	"w": "63",
	"elim": "E",
	"rs": "619",
	"div": "alc",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "4-6",
	"onerun": "27-32",
	"xtr": "6-4",
	"nextg": null,
	"vsW": "15-18",
	"ra": "804",
	"gb": "32.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_kcamlb_minmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "33-48",
	"code": "min",
	"pct": ".389",
	"league_sensitive_team_name": "Minnesota",
	"vsC": "30-42",
	"vsE": "10-29",
	"clinch": null,
	"vsL": "21-26",
	"vsR": "42-73",
	"xwl": "62-100",
	"l": "99",
	"strk": "W2",
	"lastg": "9/28 vs KC, W 1-0",
	"interleague": "8-10",
	"road": "30-51",
	"games_back_wildcard": "28.0",
	"team": "Minnesota"
}]
	var standings_rs_ale =
[{
	"w": "97",
	"elim": "-",
	"rs": "867",
	"div": "ale",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "5-5",
	"onerun": "21-24",
	"xtr": "4-12",
	"nextg": null,
	"vsW": "23-13",
	"ra": "657",
	"gb": "-",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_10_06_detmlb_nyamlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": null,
	"home": "52-29",
	"code": "nyy",
	"pct": ".599",
	"league_sensitive_team_name": "NY Yankees",
	"vsC": "22-14",
	"vsE": "39-33",
	"clinch": "y",
	"vsL": "35-17",
	"vsR": "62-48",
	"xwl": "101-61",
	"l": "65",
	"strk": "L4",
	"lastg": "10/6 vs DET, L 2-3",
	"interleague": "13-5",
	"road": "45-36",
	"games_back_wildcard": null,
	"team": "New York"
}, {
	"w": "91",
	"elim": "E",
	"rs": "707",
	"div": "ale",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "6-4",
	"onerun": "26-18",
	"xtr": "9-5",
	"nextg": null,
	"vsW": "16-18",
	"ra": "614",
	"gb": "6.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_10_04_texmlb_tbamlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "-",
	"home": "47-34",
	"code": "tb",
	"pct": ".562",
	"league_sensitive_team_name": "Tampa Bay",
	"vsC": "21-17",
	"vsE": "42-30",
	"clinch": "w",
	"vsL": "31-19",
	"vsR": "60-52",
	"xwl": "91-71",
	"l": "71",
	"strk": "W5",
	"lastg": "10/4 vs TEX, L 3-4",
	"interleague": "12-6",
	"road": "44-37",
	"games_back_wildcard": "-",
	"team": "Tampa Bay"
}, {
	"w": "90",
	"elim": "E",
	"rs": "875",
	"div": "ale",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "3-7",
	"onerun": "19-19",
	"xtr": "6-5",
	"nextg": null,
	"vsW": "21-14",
	"ra": "737",
	"gb": "7.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_bosmlb_balmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "45-36",
	"code": "bos",
	"pct": ".556",
	"league_sensitive_team_name": "Boston",
	"vsC": "21-16",
	"vsE": "38-34",
	"clinch": null,
	"vsL": "33-22",
	"vsR": "57-50",
	"xwl": "94-68",
	"l": "72",
	"strk": "L1",
	"lastg": "9/28 @ BAL, L 3-4",
	"interleague": "10-8",
	"road": "45-36",
	"games_back_wildcard": "1.0",
	"team": "Boston"
}, {
	"w": "81",
	"elim": "E",
	"rs": "743",
	"div": "ale",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "4-6",
	"onerun": "29-28",
	"xtr": "13-4",
	"nextg": null,
	"vsW": "22-17",
	"ra": "761",
	"gb": "16.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_tormlb_chamlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "42-39",
	"code": "tor",
	"pct": ".500",
	"league_sensitive_team_name": "Toronto",
	"vsC": "18-15",
	"vsE": "33-39",
	"clinch": null,
	"vsL": "23-19",
	"vsR": "58-62",
	"xwl": "79-83",
	"l": "81",
	"strk": "W1",
	"lastg": "9/28 @ CWS, W 3-2",
	"interleague": "8-10",
	"road": "39-42",
	"games_back_wildcard": "10.0",
	"team": "Toronto"
}, {
	"w": "69",
	"elim": "E",
	"rs": "708",
	"div": "ale",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "6-4",
	"onerun": "22-22",
	"xtr": "8-8",
	"nextg": null,
	"vsW": "12-18",
	"ra": "860",
	"gb": "28.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_bosmlb_balmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "39-42",
	"code": "bal",
	"pct": ".426",
	"league_sensitive_team_name": "Baltimore",
	"vsC": "22-20",
	"vsE": "28-44",
	"clinch": null,
	"vsL": "20-27",
	"vsR": "49-66",
	"xwl": "67-95",
	"l": "93",
	"strk": "W1",
	"lastg": "9/28 vs BOS, W 4-3",
	"interleague": "7-11",
	"road": "30-51",
	"games_back_wildcard": "22.0",
	"team": "Baltimore"
}]
	var standings_rs_alw =
[{
	"w": "96",
	"elim": "-",
	"rs": "855",
	"div": "alw",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "9-1",
	"onerun": "19-24",
	"xtr": "4-5",
	"nextg": null,
	"vsW": "40-17",
	"ra": "677",
	"gb": "-",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_10_28_texmlb_slnmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": null,
	"home": "52-29",
	"code": "tex",
	"pct": ".593",
	"league_sensitive_team_name": "Texas",
	"vsC": "25-18",
	"vsE": "22-22",
	"clinch": "y",
	"vsL": "26-21",
	"vsR": "70-45",
	"xwl": "98-64",
	"l": "66",
	"strk": "W6",
	"lastg": "10/28 @ STL, L 2-6",
	"interleague": "9-9",
	"road": "44-37",
	"games_back_wildcard": null,
	"team": "Texas"
}, {
	"w": "86",
	"elim": "E",
	"rs": "667",
	"div": "alw",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "3-7",
	"onerun": "27-31",
	"xtr": "8-13",
	"nextg": null,
	"vsW": "27-30",
	"ra": "633",
	"gb": "10.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_texmlb_anamlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "45-36",
	"code": "ana",
	"pct": ".531",
	"league_sensitive_team_name": "LA Angels",
	"vsC": "25-18",
	"vsE": "21-23",
	"clinch": null,
	"vsL": "32-28",
	"vsR": "54-48",
	"xwl": "85-77",
	"l": "76",
	"strk": "L4",
	"lastg": "9/28 vs TEX, L 1-3",
	"interleague": "13-5",
	"road": "41-40",
	"games_back_wildcard": "5.0",
	"team": "Los Angeles"
}, {
	"w": "74",
	"elim": "E",
	"rs": "645",
	"div": "alw",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "5-5",
	"onerun": "20-25",
	"xtr": "8-11",
	"nextg": null,
	"vsW": "26-31",
	"ra": "679",
	"gb": "22.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_oakmlb_seamlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "43-38",
	"code": "oak",
	"pct": ".457",
	"league_sensitive_team_name": "Oakland",
	"vsC": "20-24",
	"vsE": "20-23",
	"clinch": null,
	"vsL": "25-29",
	"vsR": "49-59",
	"xwl": "77-85",
	"l": "88",
	"strk": "W2",
	"lastg": "9/28 @ SEA, W 2-0",
	"interleague": "8-10",
	"road": "31-50",
	"games_back_wildcard": "17.0",
	"team": "Oakland"
}, {
	"w": "67",
	"elim": "E",
	"rs": "556",
	"div": "alw",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "4-6",
	"onerun": "26-28",
	"xtr": "6-5",
	"nextg": null,
	"vsW": "21-36",
	"ra": "675",
	"gb": "29.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_oakmlb_seamlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "39-45",
	"code": "sea",
	"pct": ".414",
	"league_sensitive_team_name": "Seattle",
	"vsC": "20-24",
	"vsE": "17-26",
	"clinch": null,
	"vsL": "13-28",
	"vsR": "54-67",
	"xwl": "67-95",
	"l": "95",
	"strk": "L2",
	"lastg": "9/28 vs OAK, L 0-2",
	"interleague": "9-9",
	"road": "28-50",
	"games_back_wildcard": "24.0",
	"team": "Seattle"
}]
	var standings_rs_nlc =
[{
	"w": "96",
	"elim": "-",
	"rs": "721",
	"div": "nlc",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "7-3",
	"onerun": "30-18",
	"xtr": "7-7",
	"nextg": null,
	"vsW": "19-14",
	"ra": "638",
	"gb": "-",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_10_16_slnmlb_milmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": null,
	"home": "57-24",
	"code": "mil",
	"pct": ".593",
	"league_sensitive_team_name": "Milwaukee",
	"vsC": "51-29",
	"vsE": "20-14",
	"clinch": "y",
	"vsL": "18-18",
	"vsR": "78-48",
	"xwl": "90-72",
	"l": "66",
	"strk": "W2",
	"lastg": "10/16 vs STL, L 6-12",
	"interleague": "6-9",
	"road": "39-42",
	"games_back_wildcard": null,
	"team": "Milwaukee"
}, {
	"w": "90",
	"elim": "E",
	"rs": "762",
	"div": "nlc",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "7-3",
	"onerun": "26-23",
	"xtr": "8-13",
	"nextg": null,
	"vsW": "16-17",
	"ra": "692",
	"gb": "6.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_10_28_texmlb_slnmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "-",
	"home": "45-36",
	"code": "stl",
	"pct": ".556",
	"league_sensitive_team_name": "St. Louis",
	"vsC": "44-35",
	"vsE": "22-13",
	"clinch": "w",
	"vsL": "20-20",
	"vsR": "70-52",
	"xwl": "88-74",
	"l": "72",
	"strk": "W2",
	"lastg": "10/28 vs TEX, W 6-2",
	"interleague": "8-7",
	"road": "45-36",
	"games_back_wildcard": "-",
	"team": "St. Louis"
}, {
	"w": "79",
	"elim": "E",
	"rs": "735",
	"div": "nlc",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "5-5",
	"onerun": "29-33",
	"xtr": "12-5",
	"nextg": null,
	"vsW": "18-14",
	"ra": "720",
	"gb": "17.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_cinmlb_nynmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "42-39",
	"code": "cin",
	"pct": ".488",
	"league_sensitive_team_name": "Cincinnati",
	"vsC": "42-37",
	"vsE": "13-20",
	"clinch": null,
	"vsL": "17-22",
	"vsR": "62-61",
	"xwl": "83-79",
	"l": "83",
	"strk": "L1",
	"lastg": "9/28 @ NYM, L 0-3",
	"interleague": "6-12",
	"road": "37-44",
	"games_back_wildcard": "11.0",
	"team": "Cincinnati"
}, {
	"w": "72",
	"elim": "E",
	"rs": "610",
	"div": "nlc",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "4-6",
	"onerun": "21-22",
	"xtr": "6-7",
	"nextg": null,
	"vsW": "13-20",
	"ra": "712",
	"gb": "24.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_pitmlb_milmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "36-45",
	"code": "pit",
	"pct": ".444",
	"league_sensitive_team_name": "Pittsburgh",
	"vsC": "39-41",
	"vsE": "12-22",
	"clinch": null,
	"vsL": "23-22",
	"vsR": "49-68",
	"xwl": "70-92",
	"l": "90",
	"strk": "L2",
	"lastg": "9/28 @ MIL, L 3-7",
	"interleague": "8-7",
	"road": "36-45",
	"games_back_wildcard": "18.0",
	"team": "Pittsburgh"
}, {
	"w": "71",
	"elim": "E",
	"rs": "654",
	"div": "nlc",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "4-6",
	"onerun": "25-28",
	"xtr": "9-5",
	"nextg": null,
	"vsW": "17-17",
	"ra": "756",
	"gb": "25.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_chnmlb_sdnmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "39-42",
	"code": "chc",
	"pct": ".438",
	"league_sensitive_team_name": "Chi Cubs",
	"vsC": "34-46",
	"vsE": "15-18",
	"clinch": null,
	"vsL": "20-24",
	"vsR": "51-67",
	"xwl": "70-92",
	"l": "91",
	"strk": "L1",
	"lastg": "9/28 @ SD, L 2-9",
	"interleague": "5-10",
	"road": "32-49",
	"games_back_wildcard": "19.0",
	"team": "Chicago"
}, {
	"w": "56",
	"elim": "E",
	"rs": "615",
	"div": "nlc",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "4-6",
	"onerun": "20-28",
	"xtr": "5-13",
	"nextg": null,
	"vsW": "14-24",
	"ra": "796",
	"gb": "40.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_slnmlb_houmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "31-50",
	"code": "hou",
	"pct": ".346",
	"league_sensitive_team_name": "Houston",
	"vsC": "28-50",
	"vsE": "10-21",
	"clinch": null,
	"vsL": "22-26",
	"vsR": "34-80",
	"xwl": "62-100",
	"l": "106",
	"strk": "L2",
	"lastg": "9/28 vs STL, L 0-8",
	"interleague": "4-11",
	"road": "25-56",
	"games_back_wildcard": "34.0",
	"team": "Houston"
}]
	var standings_rs_nle =
[{
	"w": "102",
	"elim": "-",
	"rs": "713",
	"div": "nle",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "4-6",
	"onerun": "28-19",
	"xtr": "9-10",
	"nextg": null,
	"vsW": "23-9",
	"ra": "529",
	"gb": "-",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_10_07_slnmlb_phimlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": null,
	"home": "52-29",
	"code": "phi",
	"pct": ".630",
	"league_sensitive_team_name": "Philadelphia",
	"vsC": "27-16",
	"vsE": "43-29",
	"clinch": "y",
	"vsL": "30-14",
	"vsR": "72-46",
	"xwl": "102-60",
	"l": "60",
	"strk": "W4",
	"lastg": "10/7 vs STL, L 0-1",
	"interleague": "9-6",
	"road": "50-31",
	"games_back_wildcard": null,
	"team": "Philadelphia"
}, {
	"w": "89",
	"elim": "E",
	"rs": "641",
	"div": "nle",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "2-8",
	"onerun": "29-26",
	"xtr": "14-12",
	"nextg": null,
	"vsW": "21-15",
	"ra": "605",
	"gb": "13.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_phimlb_atlmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "47-34",
	"code": "atl",
	"pct": ".549",
	"league_sensitive_team_name": "Atlanta",
	"vsC": "22-17",
	"vsE": "36-36",
	"clinch": null,
	"vsL": "24-23",
	"vsR": "65-50",
	"xwl": "85-77",
	"l": "73",
	"strk": "L5",
	"lastg": "9/28 vs PHI, L 3-4",
	"interleague": "10-5",
	"road": "42-39",
	"games_back_wildcard": "1.0",
	"team": "Atlanta"
}, {
	"w": "80",
	"elim": "E",
	"rs": "624",
	"div": "nle",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "8-2",
	"onerun": "27-27",
	"xtr": "12-8",
	"nextg": null,
	"vsW": "16-19",
	"ra": "643",
	"gb": "21.5",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_wasmlb_flomlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "44-36",
	"code": "was",
	"pct": ".497",
	"league_sensitive_team_name": "Washington",
	"vsC": "20-19",
	"vsE": "36-36",
	"clinch": null,
	"vsL": "19-17",
	"vsR": "61-64",
	"xwl": "78-83",
	"l": "81",
	"strk": "W1",
	"lastg": "9/28 @ FLA, W 3-1",
	"interleague": "8-7",
	"road": "36-45",
	"games_back_wildcard": "9.5",
	"team": "Washington"
}, {
	"w": "77",
	"elim": "E",
	"rs": "718",
	"div": "nle",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "5-5",
	"onerun": "21-28",
	"xtr": "7-7",
	"nextg": null,
	"vsW": "16-17",
	"ra": "742",
	"gb": "25.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_cinmlb_nynmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "34-47",
	"code": "nym",
	"pct": ".475",
	"league_sensitive_team_name": "NY Mets",
	"vsC": "19-20",
	"vsE": "33-39",
	"clinch": null,
	"vsL": "18-22",
	"vsR": "59-63",
	"xwl": "79-83",
	"l": "85",
	"strk": "W1",
	"lastg": "9/28 vs CIN, W 3-0",
	"interleague": "9-9",
	"road": "43-38",
	"games_back_wildcard": "13.0",
	"team": "New York"
}, {
	"w": "72",
	"elim": "E",
	"rs": "625",
	"div": "nle",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "3-7",
	"onerun": "27-32",
	"xtr": "9-13",
	"nextg": null,
	"vsW": "12-20",
	"ra": "702",
	"gb": "30.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_wasmlb_flomlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "31-47",
	"code": "fla",
	"pct": ".444",
	"league_sensitive_team_name": "Florida",
	"vsC": "20-20",
	"vsE": "32-40",
	"clinch": null,
	"vsL": "23-23",
	"vsR": "49-67",
	"xwl": "72-90",
	"l": "90",
	"strk": "L1",
	"lastg": "9/28 vs WSH, L 1-3",
	"interleague": "8-10",
	"road": "41-43",
	"games_back_wildcard": "18.0",
	"team": "Florida"
}]
	var standings_rs_nlw =
[{
	"w": "94",
	"elim": "-",
	"rs": "731",
	"div": "nlw",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "7-3",
	"onerun": "28-16",
	"xtr": "9-4",
	"nextg": null,
	"vsW": "43-29",
	"ra": "662",
	"gb": "-",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_10_07_arimlb_milmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": null,
	"home": "51-30",
	"code": "ari",
	"pct": ".580",
	"league_sensitive_team_name": "Arizona",
	"vsC": "23-17",
	"vsE": "18-14",
	"clinch": "y",
	"vsL": "24-24",
	"vsR": "70-44",
	"xwl": "88-74",
	"l": "68",
	"strk": "L1",
	"lastg": "10/7 @ MIL, L 2-3",
	"interleague": "10-8",
	"road": "43-38",
	"games_back_wildcard": null,
	"team": "Arizona"
}, {
	"w": "86",
	"elim": "E",
	"rs": "570",
	"div": "nlw",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "4-6",
	"onerun": "33-22",
	"xtr": "13-8",
	"nextg": null,
	"vsW": "43-29",
	"ra": "578",
	"gb": "8.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_colmlb_sfnmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "46-35",
	"code": "sf",
	"pct": ".531",
	"league_sensitive_team_name": "San Francisco",
	"vsC": "20-22",
	"vsE": "13-20",
	"clinch": null,
	"vsL": "26-18",
	"vsR": "60-58",
	"xwl": "80-82",
	"l": "76",
	"strk": "L1",
	"lastg": "9/28 vs COL, L 3-6",
	"interleague": "10-5",
	"road": "40-41",
	"games_back_wildcard": "4.0",
	"team": "San Francisco"
}, {
	"w": "82",
	"elim": "E",
	"rs": "644",
	"div": "nlw",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "7-3",
	"onerun": "23-21",
	"xtr": "8-3",
	"nextg": null,
	"vsW": "39-33",
	"ra": "612",
	"gb": "11.5",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_lanmlb_arimlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "42-39",
	"code": "la",
	"pct": ".509",
	"league_sensitive_team_name": "LA Dodgers",
	"vsC": "22-20",
	"vsE": "15-17",
	"clinch": null,
	"vsL": "24-20",
	"vsR": "58-59",
	"xwl": "84-77",
	"l": "79",
	"strk": "W1",
	"lastg": "9/28 @ ARI, W 7-5",
	"interleague": "6-9",
	"road": "40-40",
	"games_back_wildcard": "7.5",
	"team": "Los Angeles"
}, {
	"w": "73",
	"elim": "E",
	"rs": "735",
	"div": "nlw",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "3-7",
	"onerun": "21-27",
	"xtr": "4-8",
	"nextg": null,
	"vsW": "28-44",
	"ra": "774",
	"gb": "21.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_colmlb_sfnmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "38-43",
	"code": "col",
	"pct": ".451",
	"league_sensitive_team_name": "Colorado",
	"vsC": "22-20",
	"vsE": "15-18",
	"clinch": null,
	"vsL": "25-23",
	"vsR": "48-66",
	"xwl": "77-85",
	"l": "89",
	"strk": "W1",
	"lastg": "9/28 @ SF, W 6-3",
	"interleague": "8-7",
	"road": "35-46",
	"games_back_wildcard": "17.0",
	"team": "Colorado"
}, {
	"w": "71",
	"elim": "E",
	"rs": "593",
	"div": "nlw",
	"gameid": null,
	"status": null,
	"pre": null,
	"last10": "6-4",
	"onerun": "20-31",
	"xtr": "4-12",
	"nextg": null,
	"vsW": "27-45",
	"ra": "611",
	"gb": "23.0",
	"wrap": "/mlb/gameday/index.jsp?gid=2011_09_28_chnmlb_sdnmlb_1&mode=wrap&c_id=mlb",
	"elimination_number_wildcard": "E",
	"home": "35-46",
	"code": "sd",
	"pct": ".438",
	"league_sensitive_team_name": "San Diego",
	"vsC": "19-18",
	"vsE": "19-19",
	"clinch": null,
	"vsL": "19-30",
	"vsR": "52-61",
	"xwl": "79-83",
	"l": "91",
	"strk": "W1",
	"lastg": "9/28 vs CHC, W 9-2",
	"interleague": "6-9",
	"road": "36-45",
	"games_back_wildcard": "19.0",
	"team": "San Diego"
}]

/**
 * @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];
	}

	var showDivs	= true;
	var showSubHead	= true;

	// 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');

	// 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;
	}

	if (!showSubHead) {
		standings_head	= '';
	}

	// Build the links.
	var standings	= '';
	if (showDivs) {
		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.
	for (i = 0; i < standings_rs.length; i++) {
		// Bold the selected team.
		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.
	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']	= 'ale';
star_mlb_options['team']		= 'nyy';
addLoadEvent(star_mlb_standings);

