layoutCryptSecretDoorInside.originalEyesYPos = 0
layoutCryptSecretDoorInside.originalFaceYPos = 0
layoutCryptSecretDoorInside.hookmanScareStarted = false
layoutCryptSecretDoorInside.timeHeadRise = 350
layoutCryptSecretDoorInside.timeEyesLift = 500
layoutCryptSecretDoorInside.timeEyesDelay = 500
layoutCryptSecretDoorInside.pixelsHeadRise = 1000
layoutCryptSecretDoorInside.pixelsEyesLift = 27
layoutCryptSecretDoorInside.mFirstTime = true
-- ----------------------------------------------------------------------------
layoutCryptSecretDoorInside.mExits =
{
}

layoutCryptSecretDoorInside.mPOIs = 
{
}

layoutCryptSecretDoorInside.mHOs = 
{
}

layoutCryptSecretDoorInside.mIOs =
{
}
-- ----------------------------------------------------------------------------
function layoutCryptSecretDoorInside:onConstruct()
	
	Layout.onConstruct(self)
	
	self.originalEyesYPos = objectEyesHookman:y()
	self.originalFaceYPos = objectFaceHookman:y()
	
	objectEyesHookman:setY(self.originalEyesYPos + self.pixelsHeadRise)
	objectFaceHookman:setY(self.originalFaceYPos + self.pixelsHeadRise)

end
-- ----------------------------------------------------------------------------
function layoutCryptSecretDoorInside:onInitialize()

	Layout.onInitialize(self)
	
	objectEyesHookman:setClipRect(3, 3, self:width() - 6, 505)
	objectFaceHookman:setClipRect(3, 3, self:width() - 6, 505)

end
-- ----------------------------------------------------------------------------
function layoutCryptSecretDoorInside:onShow()

	if (self.hookmanScareStarted == false and goalCheckDoor:isStarted()) then
		self.hookmanScareStarted = true

		objectEyesHookman:animate("hookManHeadRising_blocking",
			--{ y = self.originalEyesYPos, style="easeInOut", duration = self.timeHeadRise}
			{ y = 246, style="easeInOut", duration = self.timeHeadRise}
		)
		objectFaceHookman:animate(
			--{ y = self.originalFaceYPos, style="easeInOut", duration = self.timeHeadRise}
			{ y = -378, style="easeInOut", duration = self.timeHeadRise}
		)
		
		playAudioTrack("HOOKMAN_FACE")
		self.mFirstTime = false
	elseif (self.mFirstTime) then
		think("MESSAGE_STRANGE_DOOR")
		self.mFirstTime = false
	
	end

	Layout.onShow(self)
	
end
-- ----------------------------------------------------------------------------
function layoutCryptSecretDoorInside:onAnimationFinish(animationName)

	if (animationName == "hookManHeadRising_blocking") then
		
		objectEyesHookman:animate("hookManEyesLift_blocking",
			{ y = 216, style="easeInOut", duration = self.timeEyesLift},
			{ delay = self.timeEyesDelay }
		)
	
	end

	Layout.onAnimationFinish(self, animationName)

end
-- ----------------------------------------------------------------------------
function layoutCryptSecretDoorInside:onStartAudio()
	if (not self.hookmanScareStarted) then
		getAudioManager():playTrack( { tag="SECRETDOOR_DRAUGHT", definition="IRONDOOR_DRAUGHT" } )	
	end
end
-- ----------------------------------------------------------------------------
function layoutCryptSecretDoorInside:onStopAudio()
	stopAudioTrack("SECRETDOOR_DRAUGHT")
end
