goalOpenCabin.mSteps =
{
	{ action = "click", object = objectPorchDoorknobKeyHitarea, selection = objectPorchKey },
}
-- ----------------------------------------------------------------------------
function goalOpenCabin:onStarted()
    
    objectPorchDoorknob:ss(kActive)
    objectPorchDoorknobKeyHitarea:ss(kActive)
    objectPorchDoorknobShine:ss(kIdle)
    layoutPorch:showDoorknobHiglight()
    
end
-- ----------------------------------------------------------------------------
function goalOpenCabin:onFinished()
	objectPorchDoorknob:ss(kDone)
end
-- ----------------------------------------------------------------------------
function goalOpenCabin:onLayoutShow(layout)

	if (layout == layoutLivingroom) then
		objectPorchDoorClosed:ss(kDone)
		objectPorchNote:ss(kDone)
		objectPorchDoorOpen:ss(kActive)
		self:achieved()
		play(movieSettings[kMovieLightswitch])
		
	elseif (layout == layoutPorchDoorknob and (not objectPorchKey:isDone())) then
		
		-- HELP Use inventory object
		local n =
		{
			hintIdx = 5,
			x = 203,
			y = 74,
			delayFunction = function()
				return not layoutPorchDoorknob:isTop()
			end,
			eraseFunction = function()
				return layoutLivingroom:isSeen()
			end				
		}
		queueHelpDialogExt(n)
		queueHelpArrow(7, 5, 44, 150)
		
	end

end
-- ----------------------------------------------------------------------------
function goalOpenCabin:onUsedAll(object, props)

	if (object == objectPorchDoorknobKeyHitarea) then
		
		objectPorchDoorknobKey:setAlpha(0)
		objectPorchDoorknobKey:ss(kIdle)
		objectPorchDoorknobKey:animate("PlaceKey_blocking",
			{ alpha=0							 },
			{ alpha=1,		duration=kTimeFadeIn }, 
			{ delay=kTimeDelay					 }
		)
		return true
		
	end
	
	return false
	
end
-- ----------------------------------------------------------------------------
function goalOpenCabin:onAnimationFinish(animationName)

	if (animationName == "PlaceKey_blocking") then
		layoutLivingroom:show()
		-- stop flapping note
		objectPorchNoteFlapping:ss(kDone)
	end

end