<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">var ll_currentGameCell = null;

$(document).ready(function()
{
	if ($("div.gameDate").length &gt; 0)
	{
		//	clicking events for game cells and team names
		$("div.gameDate.public").on ('click', 'td, div.teamAssignmentSlot', function (e) {
			if (!$(this).is ('.gameTime,.locationSpacer,.noGame'))
			{
				showGameDetailPopup ($(this), e);
				return false;
			}
		}).on ('click', 'td a, div.teamAssignmentSlot a', function (e) {
			e.stopPropagation ();
			return true;
		});

		//	hover effects for game cells
		$("div.gameDate.public td,div.gameDate.public div.teamAssignmentSlot")
		.not(".gameTime,.locationSpacer,.noGame,.gameField").hover (function (e) {
			$(this).addClass("hover");
		}, function (e) {
			$(this).removeClass("hover");
		}).addClass("clickable")
		.find ('a').hover (function (e) {
			$(this).addClass ("hover").parent ("td").addClass("linkHover");
		}, function (e) {
			$(this).removeClass("hover").parent("td").removeClass("linkHover");
		});
	}
	
	if ($("#teamScheduleTable").length &gt; 0)
	{
		$("#teamScheduleTable").on ('click', 'a.openGameDetail', function (e) {
			showGameDetailPopup ($(this).parent ("td"),e);
			return false;
		});
	}

	$("#gameDetailPopup a.closeWindowButton").on ('click', function () {
		clearGameCell ();
	});
});

function showGameDetailPopup (jGameCell, e)
{
	clearGameCell ();
	ll_currentGameCell = jGameCell;
	setLoadingState (true);
	cacheGetJQ("#gameDetailPopup").popupNear (jGameCell);
	
	jGameCell.addClass("viewing");
	var info = getGameCellDetails (jGameCell);
	info["Time"] = info["RealTime"];
	info["LeagueID"] = $(jGameCell).parents ("tr").attr ("id")
		? extractID ($(jGameCell).parents ("tr").attr ("id"))
		: jGameCell.parents("div.gameDate").find("input.gameDateHiddenLeagueIDInput").val();

	$.post('/async/game', info, function(response,status)
	{
		if(status == "success" &amp;&amp; response != "ERROR")
		{
			cacheGetJQ("#gameDetailPopupContent").html (response);
			if ($.browser.msie &amp;&amp; $.browser.version == "7.0")
			{
				//	WOW, this hack is almost as awful as IE7
				setTimeout (function ()
				{
					cacheGetJQ("#gameDetailPopup").width (Math.max($("table.gameDetailTable").width() + 60, 530));
				}, 300);
			}
			setLoadingState (false);
		}
		else
		{
			refreshPage ();
		}
	},"text");
}

function clearGameCell ()
{
	if (ll_currentGameCell)
	{
		ll_currentGameCell.removeClass ("viewing");
		ll_currentGameCell = null;
	}
}

//	determine whether to show the loading graphic or not
function setLoadingState (fLoading)
{
	if (fLoading)
	{
		cacheGetJQ("#gameDetailPopupContent").addClass ("hidden");
		cacheGetJQ("#schedulePopUpLoading").removeClass ("hidden");
	}
	else
	{
		cacheGetJQ("#schedulePopUpLoading").addClass ("hidden");
		cacheGetJQ("#gameDetailPopupContent").removeClass ("hidden");
	}
} 
</pre></body></html>