-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================
-- Display result dialog

local function openDlg(resultString, resultTime)
	-- Display result string
	ResultString.Text = string.upper(resultString)
	
	-- Display result time if > 0 (formatted)
	if resultTime and resultTime > 0 then
		local minutes = math.floor(resultTime/60)
		local seconds = math.floor(resultTime%60)
		if seconds < 10 then seconds = "0"..tostring(seconds)	end
		ResultTime.Text = string.upper("WINNING TIME: "..tostring(minutes)..":"..tostring(seconds))
	else
		ResultTime.Text = ""
	end
	
	dlg.Visible = true
	
	wait(DISPLAY_DURATION)
	
	dlg.Visible = false
end -- openDlg()
