function OnWarpEnter() 
	SetMarker("cs\\Warp_0218.wp" , 0 , 0) 

	ImportAnimationWarp("3D\\cs\\Warp_0019")

	-- bougie chevet
	AnimationSetToStart("cian")
	-- feu cheminée
	StartAnimationPart("cfa1",60,70,-1,false)

	if ETAT_DAY == "D4" then 
		AnimationSetToStart("cdan")
		SetMarker("TEA", 2, 0)
		SetMarker("BED", 4, 0)
	end
end

function OnWarpLeave()
end

function OnDialogFinished(dialogName)

	if dialogName == "Ma2533" then -- Pourvu que je découvre ce qui se passe avant que quelqu'un d'autre ne meure !
		PlayMovie("Videos/reveBD.ogv", "Videos/J_Dort.ogg")
	end

end

function OnWarpObjectHit(objectName)

	if objectName == "3D\\TEA" then
		Tisane = true
		AddToBag("A_tisane_eucalyptus")
		SetMarker("TEA", -1, 0)
	end

	if objectName == "3D\\BED" then
		PlayMovie("Videos/reveBD.ogv", "Videos/J_Dort.ogg")
	end
end

function OnMovieFinished(name)
	if ETAT_DAY == "D4" then
		if (name == "Videos/reveBD.ogv") then
				SetDiaryPage(19, "Page19_01")
			
				if FaceW69 and FootW69 and FingerW69 then
					SetDiaryPage(20, "Page20")
					SetDiaryPage(21, "Page21_10")
				elseif FaceW69 and FootW69 and not FingerW69 then
					SetDiaryPage(20, "Page20_04")
					SetDiaryPage(21, "Page21_04")
				elseif FaceW69 and FingerW69 and not FootW69 then
					SetDiaryPage(20, "Page20_05")
					SetDiaryPage(21, "Page21_07")
				elseif FootW69 and FingerW69 and not FaceW69 then
					SetDiaryPage(20, "Page20_06")
					SetDiaryPage(21, "Page21_09")
				elseif FingerW69 and not FootW69 and not FaceW69 then
					SetDiaryPage(20, "Page20_03")
					SetDiaryPage(21, "Page21_08")
				elseif FootW69 and not FingerW69 and not FaceW69 then
					SetDiaryPage(20, "Page20_02")
					SetDiaryPage(21, "Page21_02")
				elseif FaceW69 and not FootW69 and not FingerW69 then
					SetDiaryPage(20, "Page20_01")
					SetDiaryPage(21, "Page21_01")
				end
				
				SetDiaryPage(22, "Page22")
			if Tisane then
				Music_Change = true
				RemoveFromBag("A_tisane_eucalyptus")
				ETAT_DAY = "D5" 
				DRESS_MONK = false	
				DRESS_MADELEINE = false		
				DRESS_CESAR = true
--				ShowDocument("Dimanche")
--				PlaySound("Sounds/SFX/J_Allumer.ogg",1)
				ChangeWarp("3D\\cs\\Warp_0019.wp")
			else
				PlayMovie("Videos/Reve3.ogv", "Videos/M_Cine008.ogg")
				Music_Change = true
				ETAT_DAY = "D5" 
				DRESS_MONK = false	
				DRESS_MADELEINE = false		
				DRESS_CESAR = true
				ChangeWarp("3D\\cs\\Warp_0019.wp")
			end
		end
	end
end
