tutorialFinishQuestion_proceedToTournament = 0
tutorialFinishQuestion_curState = 1

function tutorialFinishQuestion_afterWindowClose()
	if tutorialFinishQuestion_proceedToTournament == 1 then
		if tutorialFinishQuestion_curState == 1 then
			cfunction("exitScriptSystem",UIReturnCodes["TUTORIAL_GOTOTOURNAMENT"])			
		else
			cfunction("exitScriptSystem",UIReturnCodes["TUTORIAL_EXIT"])			
		end
	else
		if tutorialFinishQuestion_curState == 1 then
			cfunction("exitScriptSystem",UIReturnCodes["TUTORIAL_RESTART"])			
		else
			cfunction("exitScriptSystem",UIReturnCodes["TUTORIAL_EXIT"])			
		end
	end
	
end

function tutorialFinishQuestion_onDownPressed()
	if tutorialFinishQuestion_curState == 1 then 
		tutorialFinishQuestion_curState = 2
	else
		tutorialFinishQuestion_curState =1
	end
	tutorialFinishQuestion_setCursorText()
end

function tutorialFinishQuestion_onUpPressed()
	if tutorialFinishQuestion_curState == 1 then 
		tutorialFinishQuestion_curState = 2
	else
		tutorialFinishQuestion_curState =1
	end
	tutorialFinishQuestion_setCursorText()
end

function tutorialFinishQuestion_onSubmitPressed()			
	cfunction("showFontOverlay", "tutorial_title", 0, 100, 0, 50)
	cfunction("showFontOverlay", "menu_content", 0, 100, 0, 100)
	closeAndDestroyPopupWindow("tutorialFinishQuestion_afterWindowClose", PopupOptions["FADETOLOADING"])			
end

function tutorialFinishQuestion_onEnterState()		
	openPopupWindow("tutorialFinishQuestion_afterWindowOpen", 1.3, 0)	
end

function tutorialFinishQuestion_setCursorText()
	if tutorialFinishQuestion_curState == 1 then 
		cfunction("setFontOverlayText", "menu_content", '\05'.."@ "..lng_YES.." @\n"..lng_NO)
	else
		cfunction("setFontOverlayText", "menu_content", '\05'..lng_YES.."\n@ "..lng_NO.." @")
	end
	
end

function tutorialFinishQuestion_afterWindowOpen()

	if tutorialFinishQuestion_proceedToTournament == 1 then
		cfunction("showFontOverlay", "tutorial_title", 1, 100, 0, 100)
		cfunction("setFontOverlayText", "tutorial_title", '\05'..lng_TUTORFINISHPROCEED)
		
		
	else
		cfunction("showFontOverlay", "tutorial_title", 1, 100, 0, 110)
		cfunction("setFontOverlayText", "tutorial_title", '\05'..lng_TUTORFINISHRETRY)		
	end
	
	cfunction("showFontOverlay", "menu_content", 1, 100, 0, 130)
	tutorialFinishQuestion_setCursorText()
	
	
--[[	
	cfunction("showFontOverlay", "tutorial_undertitle", 1, 100, 0, 210)
	cfunction("setFontOverlayText", "tutorial_undertitle", '\05'..tutorialFinishQuestion_undertitleText)
	
		
	cfunction("showFontOverlay", "tutorial_requirementCol2", 1, 100, 190, 80)
	cfunction("setFontOverlayText", "tutorial_requirementCol2", '\04'..tutorialFinishQuestion_requirementCol2Text)
	
	cfunction("showFontOverlay", "tutorial_requirementCol3", 1, 100, 275, 80)
	cfunction("setFontOverlayWidth", "tutorial_requirementCol3", 80)
	cfunction("setFontOverlayText", "tutorial_requirementCol3", '\06'..tutorialFinishQuestion_requirementCol3Text)
	
	cfunction("showFontOverlay", "tutorial_requirementCol4", 1, 100, 370, 80)
	cfunction("setFontOverlayText", "tutorial_requirementCol4", '\04'..tutorialFinishQuestion_requirementCol4Text)
	--]]
	
end

function tutorialFinishQuestion_onLeaveState()				
end
