tutorialInformationScreen_titleText = ""
tutorialInformationScreen_undertitleText = ""
tutorialInformationScreen_descText = ""
tutorialInformationScreen_image= ""
tutorialInformationScreen_isStatemorphScreen = 0
tutorialInformationScreen_isStatemorphActive = 0

tutorialInformationScreen_define_activateImageX = 112
tutorialInformationScreen_define_activateImageY = 150

function tutorialInformationScreen_afterWindowClose()
	if tutorialInformationScreen_isStatemorphScreen == 0 then
		cfunction("transitionToState", "tutorialInformationScreen")
	else
		cfunction("transitionToState", "alwaysOn")
	end
end

function tutorialInformationScreen_reloadData()
	alwaysOn_onChangeSMInputIcons()
	if tutorialInformationScreen_isStatemorphActive == 1 then
		tutorialInformationScreen_removeGfx()
		instantRemovePopupWindow()		
		cfunction("exitScriptSystem", UIReturnCodes["TUTORIAL_RETURNGAME"])		
	end
end

function tutorialInformationScreen_removeGfx()
	cfunction("showFontOverlay", "tutorial_title", 0, 100, 0, 50)
	cfunction("showFontOverlay", "tutorial_desc", 0, 100, 0, 100)		
	cfunction("showFontOverlay", "tutorial_undertitle", 0, 100, 0, 150)
	if tutorialInformationScreen_isStatemorphScreen == 0 then
		cfunction("showBitmapOverlay", tutorialInformationScreen_image, 0, 100, 176, 40)		
	else
		iSel = 1
		while iSel < 6 do
			cfunction("showBitmapOverlay", tutorialInformationScreen_image..iSel,0, 100,0,0)
			iSel = iSel + 1
		end		
	end
end


function tutorialInformationScreen_onSubmitPressed()			
	if tutorialInformationScreen_isStatemorphScreen == 0 then
		tutorialInformationScreen_removeGfx()
		closePopupWindow("tutorialInformationScreen_afterWindowClose")			
	end
	
end

function tutorialInformationScreen_onEnterState()	
	cfunction("callCPPFunction", "tutorial_createInformationScreen", "", 0)
	openPopupWindow("tutorialInformationScreen_afterWindowOpen", 3.8, 0)	
end

function tutorialInformationScreen_afterWindowOpen()
	cfunction("showFontOverlay", "tutorial_title", 1, 100, 0, 40)
	cfunction("setFontOverlayText", "tutorial_title", '\05'..tutorialInformationScreen_titleText)
	
	cfunction("showFontOverlay", "tutorial_undertitle", 1, 100, 0, 230)
	cfunction("setFontOverlayText", "tutorial_undertitle", '\05'..tutorialInformationScreen_undertitleText)
	
	
	if tutorialInformationScreen_isStatemorphScreen == 0 then
		cfunction("showBitmapOverlay", tutorialInformationScreen_image, 1, 100, 176, 40)
		cfunction("showFontOverlay", "tutorial_desc", 1, 100, 0, 135)
	else
		--cfunction("showBitmapOverlay", tutorialInformationScreen_image.."1", 1, 100, tutorialInformationScreen_define_activateImageX, tutorialInformationScreen_define_activateImageY)
		cfunction("showFontOverlay", "tutorial_desc", 1, 100, 0, 80)
		tutorialInformationScreen_act_1()
	end
	
	cfunction("setFontOverlayText", "tutorial_desc", '\05'..tutorialInformationScreen_descText)
	
end

function tutorialInformationScreen_onLeaveState()				
end

function tutorialInformationScreen_act_1()	
	cfunction("showBitmapOverlay", tutorialInformationScreen_image.."5", 0, 100, tutorialInformationScreen_define_activateImageX, tutorialInformationScreen_define_activateImageY)
	cfunction("showBitmapOverlay", tutorialInformationScreen_image.."1", 1, 100, tutorialInformationScreen_define_activateImageX, tutorialInformationScreen_define_activateImageY)
	cfunction("setTimer", 1000, "tutorialInformationScreen_act_2")
end

function tutorialInformationScreen_act_2()	
	cfunction("showBitmapOverlay", tutorialInformationScreen_image.."1", 0, 100, tutorialInformationScreen_define_activateImageX, tutorialInformationScreen_define_activateImageY)
	cfunction("showBitmapOverlay", tutorialInformationScreen_image.."2", 1, 100, tutorialInformationScreen_define_activateImageX, tutorialInformationScreen_define_activateImageY)
	cfunction("setTimer", 500, "tutorialInformationScreen_act_3")
end

function tutorialInformationScreen_act_3()	
	cfunction("showBitmapOverlay", tutorialInformationScreen_image.."2", 0, 100, tutorialInformationScreen_define_activateImageX, tutorialInformationScreen_define_activateImageY)
	cfunction("showBitmapOverlay", tutorialInformationScreen_image.."3", 1, 100, tutorialInformationScreen_define_activateImageX, tutorialInformationScreen_define_activateImageY)
	cfunction("setTimer", 200, "tutorialInformationScreen_act_4")
end

function tutorialInformationScreen_act_4()	
	cfunction("showBitmapOverlay", tutorialInformationScreen_image.."3", 0, 100, tutorialInformationScreen_define_activateImageX, tutorialInformationScreen_define_activateImageY)
	cfunction("showBitmapOverlay", tutorialInformationScreen_image.."4", 1, 100, tutorialInformationScreen_define_activateImageX, tutorialInformationScreen_define_activateImageY)
	cfunction("setTimer", 2000, "tutorialInformationScreen_act_5")
end

function tutorialInformationScreen_act_5()	
	cfunction("showBitmapOverlay", tutorialInformationScreen_image.."4", 0, 100, tutorialInformationScreen_define_activateImageX, tutorialInformationScreen_define_activateImageY)
	cfunction("showBitmapOverlay", tutorialInformationScreen_image.."5", 1, 100, tutorialInformationScreen_define_activateImageX, tutorialInformationScreen_define_activateImageY)
	cfunction("setTimer", 2000, "tutorialInformationScreen_act_1")
end

