layoutWoods1Trunk.mPOIs = 
{
	[objectPoiJarDown] = 
	{
		target = layoutWoods1Trunkfloor,
	},
}

layoutWoods1Trunk.mHOs = 
{
	[objectHoJackstand] = 
	{
		siblings = {objectHoJackstandLit, objectHoJackstandPocket}
	},
	[objectHoLugwrench] = 
	{
		siblings = {objectHoLugwrenchLit, objectHoLugwrenchPocket}
	},
	[objectHoTire] = 
	{
		siblings = {objectHoTireLit, objectHoTirePocket}
	},
}

layoutWoods1Trunk.mIOs =
{
	[objectIoJarUp] = 
	{
	
	},
	[objectIoCarBackTrunkLock] = 
	{
		links = {objectHoTrunkKey},
	},
}
-- ----------------------------------------------------------------------------
function layoutWoods1Trunk:onConstruct()
	
	Layout.onConstruct(self)
	
end
-- ----------------------------------------------------------------------------
function layoutWoods1Trunk:onInitialize()

	Layout.onInitialize(self)
	
	objectPoiJarDown:ss(kInactive)

end
-- ----------------------------------------------------------------------------
function layoutWoods1Trunk:onClickIO(object, x, y)
	
	if (object == objectIoJarUp) then
	
		think("MESSAGE_OOPS")
		
		objectPoiJarDown:setAlpha(0)
		objectPoiJarDown:ss(kIdle)		
		objectPoiJarDown:animate("tipJar_blocking",
			{ alpha=0									},
			{ alpha=1,		duration=kTimeFadeSwitch	}
		)
		
		objectIoJarUp:ss(kIdle)		
		objectIoJarUp:animate(
			{ command="playTrack track=SPILL_BOLTS", target=self },		
			{ alpha=0,		duration=kTimeFadeSwitch	}
		)
		
		return true
	
	end
	
	return Layout.onClickIO(self, object, x, y)
	
end
-- ----------------------------------------------------------------------------
function layoutWoods1Trunk:onAnimationFinish(animationName)
	
	Layout.onAnimationFinish(self, animationName)
	
	if (animationName == "tipJar_blocking") then
		
		objectIoJarUp:ss(kDone)
		objectPoiJarDown:ss(kActive)
	
	elseif (animationName == "openTrunk_blocking") then
		
		-- Woods1 layout:
		objectIoTrunkClosed:ss(kDone)
		objectPoiTrunkOpen:ss(kActive)
		-- Woods1Trunk (this) layout:
		objectCarBackTrunkClosed:ss(kDone)
		objectIoCarBackTrunkLock:ss(kDone)
		
		-- Also, goalOpenTrunk:onAnimationFinish("openTrunk_blocking") achieves that goal.
	
	end

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

	if (object == objectIoCarBackTrunkLock) then
		
		-- Woods1 layout:
		crossFadeImages(objectIoTrunkClosed, objectPoiTrunkOpen, "openTrunk")
		
		-- Woods1Trunk (this) layout:
		objectCarBackTrunkClosed:ss(kIdle)		
		objectCarBackTrunkClosed:animate("openTrunk_blocking",
			{ alpha=0,		duration=kTimeFadeSwitch	}
		)
		objectIoCarBackTrunkLock:ss(kIdle)		
		objectIoCarBackTrunkLock:animate(
			{ alpha=0,		duration=kTimeFadeSwitch	}
		)
		
		-- activate the objects
		objectHoTire:ss(kActive)
		objectHoLugwrench:ss(kActive)
		objectHoJackstand:ss(kActive)
		
		return true		
	end

	return Layout.onUsedAll(self, object, props)
	
end