/**
 * To make sure the timer state is maintained during ajax clicks through the tabs

timerReminder = function(){
	if(getUpdateFlag() === "on" || getUpdateFlag() === null || getUpdateFlag() === "undefined")
		{stopTimers();startTimers();$("#tOn").click();}
		if(getUpdateFlag() === "off"){
		$("#tOff").click();}
}
 */
/**
 * Style the Play By Play filter links
 */
linkStyler = function(){$("a.pBpLink").css("font-weight", "bold").css("cursor", "pointer");}
/**window.onload = function(){linkStyler();}
 *
 * Tabs functionality for Games Pages
 */
previewClicked = (function(){
	$("#aPreview").addClass('selected');
	$("#aBox, #aPlay, #aRecap").removeClass("selected").addClass("active");
	$("#aRecap").addClass("lastTab");
});
boxscoreClicked = (function(){
	$("#aBox").addClass('selected');
	$("#aPreview, #aPlay, #aRecap").removeClass("selected").addClass("active");
	$("#aRecap").addClass("lastTab");
});
pbpClicked = (function(){
	$("#aPlay").addClass('selected');
	$("#aBox, #aPreview, #aRecap").removeClass("selected").addClass("active");
	$("#aRecap").addClass("lastTab");
});
recapClicked = (function(){
	$("#aRecap").addClass('selected');
	$("#aBox, #aPlay, #aPreview").removeClass("selected").addClass("active");
	$("#aRecap").addClass("lastTab");
});
var boxScoreURL = "/ajax/controller?providerLoc=/cbk/games&dataProvider=boxscore"+"&gameCode="+gameCode;
var gamePreviewURL = "/ajax/controller?providerLoc=/cbk/games&dataProvider=preview&homeTeam="+homeTeam+"&visitingTeam="+visitingTeam+"&gameDate="+gameDate+"&gameCode="+gameCode;
var playByPlayURL = "/ajax/controller?providerLoc=/cbk/games&dataProvider=play-by-play";//&homeTeam="+homeTeam+"&visitingTeam="+visitingTeam+"&gameDate="+gameDate+"&gameCode="+gameCode;
var playByPlayURLall = "/ajax/controller?providerLoc=/cbk/games&dataProvider=play-by-play";//&homeTeam="+homeTeam+"&visitingTeam="+visitingTeam+"&gameDate="+gameDate+"&gameCode="+gameCode+"&mode=all";
var playByPlayURL1 = "/ajax/controller?providerLoc=/cbk/games&dataProvider=play-by-play";//&homeTeam="+homeTeam+"&visitingTeam="+visitingTeam+"&gameDate="+gameDate+"&gameCode="+gameCode+"&mode=1";
var playByPlayURL2 = "/ajax/controller?providerLoc=/cbk/games&dataProvider=play-by-play";//&homeTeam="+homeTeam+"&visitingTeam="+visitingTeam+"&gameDate="+gameDate+"&gameCode="+gameCode+"&mode=2";
var gameRecapURL = "/ajax/controller?providerLoc=/cbk/games&dataProvider=recap";//&homeTeam="+homeTeam+"&visitingTeam="+visitingTeam+"&gameDate="+gameDate+"&gameCode="+gameCode;
/**
 * Need to be able to call .jspf directly. Follow up Monday and find 
 * out if its allowed. It seems that any request for the jspf returns
 * an entire page.
 */
ajaxer1 = 	function(){
			stopTimers();
			$("div.gamesPreview").load("/ajax/controller?providerLoc=/cbk/games&dataProvider=preview",{homeTeam:homeTeam,visitingTeam:visitingTeam,gameDate:gameDate,gameCode:gameCode,awayTeamMascotName:awayTeamMascotName,homeTeamMascotName:homeTeamMascotName});
			previewClicked();}

ajaxer2 = function(){
			stopTimers();
			$("div.gamesPreview").load("/ajax/controller?providerLoc=/cbk/games&dataProvider=boxscore",{homeTeam:homeTeam,visitingTeam:visitingTeam,gameDate:gameDate,gameCode:gameCode});
			boxscoreClicked();
			startTimers();}
ajaxer3 = function(){
			stopTimers();
			$("div.gamesPreview").load(playByPlayURLall,{homeTeam:homeTeam,visitingTeam:visitingTeam,gameDate:gameDate,gameCode:gameCode});
			pbpClicked();
			startTimers();
			linkStyler();
			};
ajaxer4 = function(){
			$("div.gamesPreview").load(gameRecapURL,{homeTeam:homeTeam,visitingTeam:visitingTeam,gameDate:gameDate,gameCode:gameCode,awayTeamMascotName:awayTeamMascotName,homeTeamMascotName:homeTeamMascotName});
			recapClicked();
			};
ajaxer5 = function(){
			stopTimers();
			$("div.gamesPreview").load(playByPlayURLall,{homeTeam:homeTeam,visitingTeam:visitingTeam,gameDate:gameDate,gameCode:gameCode});
			startTimers();
			linkStyler();
			};
ajaxer6 = function(){
			stopTimers();
			$("div.gamesPreview").load(playByPlayURL1,{homeTeam:homeTeam,visitingTeam:visitingTeam,gameDate:gameDate,gameCode:gameCode,mode:1});
			linkStyler();
			startTimers();
			linkStyler();
			};
ajaxer7 = function(){
			stopTimers();
			$("div.gamesPreview").load(playByPlayURL2,{homeTeam:homeTeam,visitingTeam:visitingTeam,gameDate:gameDate,gameCode:gameCode,mode:2});
			startTimers();
			linkStyler();
			};
/**
 * function to trigger the timers based on autoUpdate flag value
 
$(function(){
		if (disableUpdate === false)
		{
			if(getUpdateFlag() === "on" || getUpdateFlag() === null || getUpdateFlag() === "undefined")
			{stopTimers();startTimers();$("#tOn").click();}
		}
		if (disableUpdate === true)
		{
			if(getUpdateFlag() === "off"){
			$("#tOff").click();}
		}
});*/
