$(function()
{
	$table = $("table.team-schedule");
	$("tr:odd", $table).addClass("even");
	$("tr:not(thead tr)", $table).hover(function()
	{
		$(this).addClass("hover");
	}, function()
	{
		$(this).removeClass("hover");
	});
	$(".team-group li").addClass("clickable");
	$(".team-group li").click(function()
	{
		$("td", $table).removeClass("selected");
		str = $(this).text();
		teamNum = str.substr(0, str.indexOf(")"));
		$($table).each(function(e)
		{
			$("td", this).each(function(i)
			{
				str = $(this).text();
				team1 = str.substr(0, str.indexOf("v"));
				team1.replace(/\s+/g, '');
				team2 = str.substr(str.indexOf("v") + 1, str.length);
				team2.replace(/\s+/g, '');
				teamNum = parseInt(teamNum);
				team1 = parseInt(team1);
				team2 = parseInt(team2);
				if ((team1 == teamNum) || (team2 == teamNum))
				{
					$(this).addClass("selected");
				}
			});
		});
	});
});
