function OnWarpEnter()
	
	if not Video_os_37 then
		PlayMovie("Videos/GC_C13_Montage.ogv", "Videos/cine13.ogg")
		
	else
		SetMarker("OSG1",4,0)
	end

	StartAnimationPart("SPG1",18,19,-1,true)
	if KnifeGiven_os_037 then
		SetMarker("SPG1",4,0)
	end

	StartAnimation("OSG1",-1,true)
	LookAt(181,340)
	
	if STAIRS_SET  then
		AnimationSetToEnd("MMG1",true)
		AnimationSetToEnd("SPG1")
	end

	--fin puzzle animation conditions
end

function OnMovieFinished(id)
	if not Video_os_37 then
		if not KnifeGiven_os_037 then
			DrawText("OSIR1194","OSIR1194.ogg")
			DrawText("OSIR1195","OSIR1195.ogg")
			DrawText("MAIA1196","MAIA1196.ogg")
			DrawText("OSIR1197","OSIR1197.ogg")
			DrawText("OSIR1198","OSIR1198.ogg")
		end
		Video_os_37=true
	else
		ChangeWarp("3D\\Memphis\\Warp_0024.wp")
	end
end
function OnWarpLeave()
end

function OnAnimationFinished(objectName)
	if objectName=="SPG1" then
		StartAnimation("MMG1",1,true)
	elseif objectName=="MMG1" then
		SetMarker("MMG1",4,0)
		AnimationSetToEnd("MMG1",true)
		STAIRS_SET = true
	end
end

function OnDialogFinished(dialogName)
	if dialogName=="OSIR1198" then
		SetMarker("OSG1",4,0)
	end
	if dialogName=="OSIR1208" and not AskSep_os_037 then
		AskSeparation()
		AskSep_os_037=true
	elseif AskSep_os_037 then
		if dialogName=="OSIR1206" or dialogName=="OSIR1211" or dialogName=="OSIR1213" then
			AskSeparation()
		end
	end
	if dialogName=="OSIR1215" then
		AddToBag("J_Pot_onguent")
	end

end

function AskSeparation()
        PushAnswer("MAIA1209")
        PushAnswer("MAIA1210")	
	PushAnswer("MAIA1212")
        PushAnswer("MAIA1214")
end

function OnAnswered(textId)

	if textId == "MAIA1209" then
		DrawText("MAIA1209","MAIA1209.ogg")
		DrawText("OSIR1206","OSIR1206.ogg")
	
		
	elseif textId == "MAIA1210" then
		DrawText("MAIA1210","MAIA1210.ogg")
		DrawText("OSIR1211","OSIR1211.ogg")
		

	elseif textId == "MAIA1212" then
		DrawText("MAIA1212","MAIA1212.ogg")
		DrawText("OSIR1213","OSIR1213.ogg")
		
	
	elseif textId == "MAIA1214" then 
		SetMarker("SPG1",4,0)
		DrawText("MAIA1214","MAIA1214.ogg")
		if not First_Osiris_Dialog then
			DrawText("OSIR1215","OSIR1215.ogg")
			First_Osiris_Dialog=true
		else
			DrawText("OSIR1216","OSIR1216.ogg")	
		end

	end
end


function OnWarpObjectHit(objectName)
	if objectName == "11G1" then

------------------------------------------------------------
	elseif objectName == "BEG1" then

------------------------------------------------------------
	elseif objectName == "MMG1" then
			PlayMovie("Videos/GC_C12_Montage.ogv", "Videos/cine12.ogg")
------------------------------------------------------------
	elseif objectName == "OSG1" then
		if Selected("J_Couteau_etrange") then

			DrawText("OSIR1201","OSIR1201.ogg")
			DrawText("OSIR1202","OSIR1202.ogg")
			DrawText("OSIR1203","OSIR1203.ogg")
			DrawText("MAIA1204","MAIA1204.ogg")
			DrawText("OSIR1205","OSIR1205.ogg")
			DrawText("OSIR1206","OSIR1206.ogg")
			DrawText("MAIA1207","MAIA1207.ogg")
			DrawText("OSIR1208","OSIR1208.ogg")	
			KnifeGiven_os_037=true
			
			SetMarker("SPG1",4,0)
			

		elseif ObjectInHand() and not KnifeGiven_os_037 then
			DrawText("OSIR1199","OSIR1199.ogg")
		elseif KnifeGiven_os_037 then
			AskSeparation()
		elseif  not KnifeGiven_os_037 then
			DrawText("OSIR1198","OSIR1198.ogg")
		end
------------------------------------------------------------
	elseif objectName == "SPG1" and not ReadyStair_os_37 then
		if Selected("J_serpent") and KnifeGiven_os_037 then
			ReadyStair_os_37=true
			SetMarker("SPG1",-1,0)
			RemoveFromBag()
			StartAnimation("SPG1",1,true)
		elseif ObjectInHand() and KnifeGiven_os_037 then
			DrawText("MAIA0173","MAIA0173.ogg")
		elseif KnifeGiven_os_037 then 
			DrawText("MAIA1229","MAIA1229.ogg")
		end
	end
   
		

end
