-- ----------------------------------------------------------------------------
layoutPorchNote.mExits =
{
}
layoutPorchNote.mPOIs = 
{
}
layoutPorchNote.mHOs = 
{
}
layoutPorchNote.mIOs =
{
}
-- ----------------------------------------------------------------------------
layoutPorchNote.countingStarted = false
layoutPorchNote.timer = 12000			-- Time to read porch note (after which key is added to shopping list)
-- ----------------------------------------------------------------------------
function layoutPorchNote:onHide()

	Layout.onHide(self)

	if (goalFindKey:isStarted() and not goalFindKey:isFinished() and
		goalFindKey.dispatchedKey == false) then
		
		goalFindKey:dispatchKey()
		
	end
	
    -- HELP hint bug
	if (objectFirefly001:isActive()) then
		local n =
		{
			hintIdx = 21,
			x = 298,
			y = 90,
			delayFunction = function()
				return not layoutPorch:isTop()
			end,
			eraseFunction = function()
				return not objectFirefly001:isActive()
			end			
		}
		queueHelpDialogExt(n)
		queueHelpArrow(22, 21, 779, 250)
	end	
	
	if (layoutPorchRock:getShowCount() == 0) then
		think("MESSAGE_GOAL_02_THOUGHTS_HACK")
		
	end

end
-- ----------------------------------------------------------------------------
function layoutPorchNote:onTick(time)

	Layout.onTick(self, time)
	
	if (self.countingStarted == true) then
		self.timer = self.timer - time

		if (self.timer < 0) then
			self.countingStarted = false
			goalFindKey:dispatchKey()

		end
		
	end
	
end
-- ----------------------------------------------------------------------------
function layoutPorchNote:onStartAudio()

	-- Play some outside noises
	playAmbientAudio(kOutsideHutAmbientGroup)

end