function tournamentSumResult_onEnterState()	
	cfunction("enableInput", 1)
	
	cfunction("callCPPFunction", "createTournamentSumResult", "", 0)
	
	resultList_setNumberOfOpponents(flow_arcadeNumberOfOpponents)
	resultList_setPlayerIndex(flow_tournamentTotalPosition)
	resultList_setHeader(tournamentSumResult_fontOverlayHeader)
	resultList_show()
end

function tournamentSumResult_onLeaveState()	
	cfunction("enableInput", 0)	
end



function tournamentSumResult_onUpPressed()
	resultList_inputUp()	
end

function tournamentSumResult_onDownPressed()
	resultList_inputDown()
end

function tournamentSumResult_onSubmitPressed()
	cfunction("enableInput", 0)
	resultList_hide()

	cfunction("setTimer", 250, "tournamentSumResult_afterTextFadeOut")

	cfunction("fadeOverlay", "resultLevelName", 100,0,25)
	cfunction("fadeOverlay", "tournamentStatus", 100,0,25)
	cfunction("fadeOverlay", "resultLevelRecord", 100,0,25)
end

function tournamentSumResult_afterTextFadeOut()
	cfunction("showFontOverlay", "resultLevelName", 0,100,0,17)
	cfunction("showFontOverlay", "tournamentStatus", 0,100,0,252)
	cfunction("showFontOverlay", "resultLevelRecord", 0,100,0,35)
	closePopupWindow("tournamentSumResult_afterTextFadeOut2")	
end

function tournamentSumResult_afterTextFadeOut2()
	if flow_tournamentTrackInTournament == tournamentData[flow_tournamentId]["numTracks"] then		
		if flow_tournamentCurrentPointsPlayer >= tournamentData[flow_tournamentId]["pointsNeeded"] then
			cfunction("transitionToState", "tournamentVictory")
		else
			cfunction("transitionToState", "tournamentNotEnoughPoints")		
		end
	else
		cfunction("transitionToState", "tournamentProceedQuestion")
	end
end