/*** Begin new championship code ****/
	
	/*function to display flight level reports*/
	function ChampAnchor(ChampYear,ChampID,ChampFlightID)
	{
		var sData = "?Level=C&ChampYear=" + ChampYear + "&ChampID=" + ChampID + "&ChampFlightID=" + ChampFlightID;
		top.window.location.href = "TeamTennisReports.aspx" + sData;
	}
	
	function ChampFlightAnchor(ChampYear,ChampID,ChampFlightID)
	{
		var sData = "?Level=CF&ChampYear=" + ChampYear + "&ChampID=" + ChampID + "&ChampFlightID=" + ChampFlightID;
		top.window.location.href = "TeamTennisReports.aspx" + sData;
	}
	
	function ChampFlightSiteUsage(ChampYear,ChampID,ChampFlightID)
	{
		var sData = "?Level=CFSU&ChampYear=" + ChampYear + "&ChampID=" + ChampID + "&ChampFlightID=" + ChampFlightID;
		top.window.location.href = "TeamTennisReports.aspx" + sData;
	}
	
	function ChampTeamSummary(ChampYear,ChampID,ChampFlightID,ChampTeamID)
	{
		var sData = "?Level=CTS&ChampYear=" + ChampYear + "&ChampID=" + ChampID + "&ChampFlightID=" + ChampFlightID + "&ChampTeamID=" + ChampTeamID;
		top.window.location.href = "TeamTennisReports.aspx" + sData;
	}	

	/***function to display Completed Score Card ***/
	function ChampMatchAnchorForCompletedSC(ChampMatchID)
	{		
		var sData = "?MatchTab=CM&Preview=Yes&MatchID=" + ChampMatchID;			
		top.frames[1].location.href = "../Main/CompletedScoreCard.aspx" + sData;
	}
	
	/***function to display Match Blank Score Card ***/
	function ChampMatchAnchorForMatchBlankSC(ChampMatchID)
	{
		var sData = "?MatchTab=CM&MatchID=" + ChampMatchID;
		top.frames[1].location.href = "../Main/MatchBlankScoreCard.aspx" + sData;
	}
	
	function ChampNationalAnchor(ChampYear)
	{
		var sData = "?Level=CN&ChampYear=" + ChampYear;
		top.window.location.href = "TeamTennisReports.aspx" + sData;
	}
	
	function ChampRegionalAnchor(ChampYear,SectionCode)
	{
		var sData = "?Level=CR&ChampYear=" + ChampYear + "&SectionCode=" + SectionCode;
		top.window.location.href = "TeamTennisReports.aspx" + sData;
	}	
	
	function ChampSectionAnchor(ChampYear,SectionCode)
	{
		var sData = "?Level=CS&ChampYear=" + ChampYear + "&SectionCode=" + SectionCode;
		top.window.location.href = "TeamTennisReports.aspx" + sData;
	}
	
	function ChampDistrictAnchor(ChampYear,SectionCode, DistrictCode)
	{
		var sData = "?Level=CD&ChampYear=" + ChampYear + "&SectionCode=" + SectionCode + "&DistrictCode=" + DistrictCode;
		top.window.location.href = "TeamTennisReports.aspx" + sData;
	}
	
	function ChampAreaAnchor(ChampYear,SectionCode, DistrictCode, AreaID)
	{
		var sData = "?Level=CA&ChampYear=" + ChampYear + "&SectionCode=" + SectionCode + "&DistrictCode=" + DistrictCode + "&AreaID=" + AreaID;
		top.window.location.href = "TeamTennisReports.aspx" + sData;
	}
	
	function ChampProgramAnchor(ChampYear,SectionCode, DistrictCode, AreaID, LeagueID)
	{
		var sData = "?Level=CP&ChampYear=" + ChampYear + "&SectionCode=" + SectionCode + "&DistrictCode=" + DistrictCode + "&AreaID=" + AreaID + "&LeagueID=" + LeagueID;
		top.window.location.href = "TeamTennisReports.aspx" + sData;
	}
	
/***End new championship code ****/



/***function to display individual player record reports***/
function IndividualAnchor(MemberID, ChampYear)
{
	var sData = "?Level=I&MemberID=" + MemberID + "&ChampYear=" + ChampYear;
	top.window.location.href = "TeamTennisReports.aspx" + sData;
}

/***function to display team level reports***/
function TeamAnchor(TeamID, ChampYear)
{
	var sData = "?Level=T&TeamID=" + TeamID + "&ChampYear=" + ChampYear;
	top.window.location.href = "../Reports/TeamTennisReports.aspx" + sData;
}

/***function to display Completed Score Card ***/
function MatchAnchorForCompletedSC(MatchID)
{
	/*** Begin new championship code ****/
	/***added MatchTab in the query string***/
	var sData = "?MatchTab=M&Preview=Yes&MatchID=" + MatchID;
	/*** End new championship code ****/
	top.frames[1].location.href = "../Main/CompletedScoreCard.aspx" + sData;
}

/***function to display Team Blank Score Card ***/
function MatchAnchorForBlankSC(TeamNo,ChampYear)
{
	/*** Begin new championship code ****/
	/***added MatchTab in the query string***/
	var sData = "?MatchTab=M&TeamNumber=" + TeamNo + "&ChampYear=" + ChampYear;
	/*** End new championship code ****/
	top.frames[1].location.href = "../Main/TeamBlankScoreCard.aspx" + sData;
}


/***function to display Match Blank Score Card ***/
function MatchAnchorForMatchBlankSC(MatchID)
{
	/*** Begin new championship code ****/
	/***added MatchTab in the query string***/
	var sData = "?MatchTab=M&MatchID=" + MatchID;
	/*** End new championship code ****/
	top.frames[1].location.href = "../Main/MatchBlankScoreCard.aspx" + sData;
}

/***function to display flight level reports***/
function FlightAnchor(FlightID, ChampYear)
{
	var sData = "?Level=F&FlightID=" + FlightID + "&ChampYear=" + ChampYear;
	top.window.location.href = "TeamTennisReports.aspx" + sData;
}

/***function to display league level reports***/
function LeagueAnchor(LeagueID, ChampYear)
{
	var sData = "?Level=L&LeagueID=" + LeagueID + "&ChampYear=" + ChampYear;
	top.window.location.href = "TeamTennisReports.aspx" + sData;
}


/*** Print, Back, Export Support ***/
/***function to send the report to excel***/
function SendToExcel() 
{
	var sData = "&Excel=1";
	/*** Begin new championship code ****/
	/****Remove the existing if condition and with the code below***/
	if ((window.top.frames[1].document.forms[0].elements['hidExcelURL'].value == "false") || (window.top.frames[1].document.forms[0].elements['hidExcelURL'].value == "0"))
	{
	/*** End new championship code ****/
		alert("This report is not available in Excel");
	}
	else 
	{
		var URL = window.top.frames[1].document.forms[0].elements['hidExcelURL'].value + sData;
		window.open(URL);	
	}
}


/***function to send the report for print***/
function PrintReport() {

	var sData = "&Print=1";
	var URL;
	if (!(window.top.frames[1].document.forms[0].elements['hidPrintURL']) || 
		(window.top.frames[1].document.forms[0].elements['hidPrintURL'].value == "false") || 
		(window.top.frames[1].document.forms[0].elements['hidPrintURL'].value == "0") ||
		(window.top.frames[1].document.forms[0].elements['hidPrintURL'].value == ""))
	{
		alert("This report is not available for printing.");
	}
	else{
		if (top.frames[1]) {
			top.frames[1].focus();
			URL = window.top.frames[1].document.forms[0].elements['hidPrintURL'].value + sData;
			var PrintWindow = window.open(URL);
		} else {
			URL = window.top.frames[1].document.forms[0].elements['hidPrintURL'].value + sData;
			var PrintWindow = window.open(URL);	
		}
	}
}


/***function to go back***/
function GoBack() {
	if (window.back) {
		window.back();
	} else {
		window.history.back();
	}
}

