function OnWarpEnter() 
	SetMarker("cs\\Warp_0015.wp" , 0 , 0)
	SetMarker("zoomCesar", 4, 0)

	--DAY3
	if ETAT_DAY == "D3" then
	 
	    if not COFFRET_OPENED then
		AnimationSetToStart("cpan",false)
		if not DESK_COVER_MOVED then
			-- barre métallique
			PutObject("cqa1",true)
			-- couverture sur le coffre
			AnimationSetToStart("cban",true)
			--SetMarker("cba1",4,0)
		elseif DESK_COVER_MOVED and not METAL_ROD_REMOVED_0017_D3 then
			-- couverture sur le coffre
			AnimationSetToEnd("cban",false)
			-- barre métallique
			PutObject("cqa1",true)
			-- couvercle coffre
			SetMarker("cpan",4,0)
		elseif DESK_COVER_MOVED  and METAL_ROD_REMOVED_0017_D3 then
			-- couverture sur le coffre
			AnimationSetToEnd("cban",false)
			SetMarker("cban",4,0)
		end
	    else
			StartAnimationPart("cpan",14,15,-1,false)
			-- couverture sur le coffre
			AnimationSetToEnd("cban",false)
			if not NOTE_TAKEN_0017_D3 then
				-- recette aphrodisiaque
				PutObject("cja1",true)
				SetMarker("cja1",2,0)
			end
	    end

	end 

	--DAY4
	if ETAT_DAY == "D4" then 
		if not NOTE_TAKEN_0017_D3 then
			PutObject("cja1",true)
		end
		if not METAL_ROD_REMOVED_0017_D3 then
			-- barre métallique
			PutObject("cqa1",true)
			if  DESK_COVER_MOVED then
				SetMarker("cqa1",2,0)
			end
		end
		if not LookAtCesarSafe then
			LookAt(148,44)
			DrawText("Ma2311","Ma2311.ogg",0) -- On dirait que les tremblements de terre ont eu raison des trésors de César ! Je ne me souvenais pas que ce coffre était dégagé.
			LookAtCesarSafe = true
		end
		if not DESK_COVER_MOVED then
			-- couvercle coffre
			AnimationSetToStart("cpan",false)
			StartAnimationPart("cban",1,2,-1,false)
			SetMarker("cban",4,0)
		else
			AnimationSetToEnd("cban",false)
		end
		if not COFFRET_OPENED  then
			-- couvercle coffre
			AnimationSetToStart("cpan",false)
			if DESK_COVER_MOVED then
				SetMarker("cpan",4,0)
			end
		else
			-- couvercle coffre
			StartAnimationPart("cpan",15,16,-1,false)
			if not NOTE_TAKEN_0017_D3 then
				PutObject("cja1",true)
				SetMarker("cja1",4,0)
			end
		end
	end
end

function OnWarpLeave()
end

function OnAnimationFinished(objectName)
	if objectName == "cban" then
		AnimationSetToEnd("cban",false)
		DESK_COVER_MOVED = true
		-- couvercle coffre
		SetMarker("cpan",4,0)
	end
	-- couvercle coffre
	if objectName == "cpan" then
		StartAnimationPart("cpan",15,16,-1,false)
		COFFRET_OPENED = true
		SetMarker("cja1",2,0)
		DrawText("Ma2314", "Ma2314.ogg", 0) -- Je ne suis pas sûre que le contenu de ce coffre vaille la peine d'être si bien protégé.
	end
end

function OnWarpObjectHit(objectName)
	if objectName == "3D\\zoomCesar" then 
		ShowDocument("PeintureCesar")
		DrawText("Ma1908", "Ma1908.ogg", 0)
	end
	if objectName == "3D\\cs\\Warp_0015.wp" then 
		ChangeWarp(objectName)
	end

--DAY3
if ETAT_DAY == "D3" or ETAT_DAY == "D4" or ETAT_DAY == "D5" then 
		if objectName == "cja1" then
			if not NOTE_TAKEN_0017_D3 and COFFRET_OPENED then
				RemoveObject("cja1")
				AddToBag("A_recette_aphrodisiaque")
				RemoveFromBag("A_recette_aphrodisiaque")
				SetRecipiesPage(8, "Page8")
				SetRecipiesPage(9, "Page9")
				NOTE_TAKEN_0017_D3 = true
				SetMarker("cja1",-1,0)
			end
		elseif objectName == "cqa1" then
			if Puzzle2_Solved  and not METAL_ROD_REMOVED_0017_D3 then
				RemoveObject("cqa1")
				SetMarker("cqa1",-1,0)
				SetMarker("cpan",4,0)
				PlaySound("Sounds/SFX/N_OuvrirMecanismeSerrure.ogg", 1)
				METAL_ROD_REMOVED_0017_D3 = true
			elseif not Puzzle2_Solved  and not METAL_ROD_REMOVED_0017_D3 then
				DrawText("Ma2313", "Ma2313.ogg", 0) -- Quelque chose la retient. César n'a décidément pas envie qu'on fouille ses affaires !
			end
		elseif objectName == "cban" then
			if not DESK_COVER_MOVED then
				-- couvercle coffre
				AnimationSetToStart("cpan",false)
				StartAnimationPart("cban",1,29,1,false)
				SetMarker("cban",-1,0)
				PlaySound("Sounds/SFX/E_cb_drap_Glisse.ogg",1)
			end
		elseif objectName == "cpan" then
			if not ScalpelW17 then
				ShowToolBox("W17_00")
			elseif ScalpelW17 and not PincerW17 then
				ShowToolBox("W17_01")
			elseif PincerW17 and not SafeW17 then
				ShowToolBox("W17_02")
			elseif SafeW17 and not Puzzle2_Solved then
				ShowPuzzle(2)
			elseif Puzzle2_Solved and METAL_ROD_REMOVED_0017_D3 and not COFFRET_OPENED then
				SetMarker("cpan",-1,0)
				StartAnimationPart("cpan", 0, 15, 1,  false)
				PlaySound("Sounds/SFX/E_ArmoireOuverture.ogg",1)
			end
		end
	end 

--DAY4
	if ETAT_DAY == "D4" then 
		--bottes
		if objectName == "caa1" then
		-- vêtements de César
		elseif objectName == "cca1" then
		-- recette aphrodisiaque
		elseif objectName == "cja1" then
		elseif objectName == "cjan" then
		-- barre métallique
		elseif objectName == "cqa1" then
		elseif objectName == "cqan" then
		-- couverture sur le coffre
		elseif objectName == "cban" then
		elseif objectName == "cban" then
		elseif objectName == "cpan" then
		elseif objectName == "cpan" then
		end
	end
end

function OnDocumentClosed(documentId)
	if documentId == "PeintureCesar" then
	end
end 

function OnChestPuzzleAnswered()
	Puzzle2_Solved = true
	SetMarker("cqa1",2,0)
	SetMarker("cpan",-1,0)
end