local createComposition09_doctor_BG = nil
local createCompositionback_compos = nil
local createCompositionPilka = nil
local createCompositionpiluka = nil
---------------------------------------------------------------------------------------
local PREFIX_PATH = "data/Texture/Scenes/09_doctor/main/anim/bg/"
---------------------------------------------------------------------------------------
function Loader_09_BG_Animations(parent)
	return CreateAnimationLoadingRoutine(parent, PREFIX_PATH,
		{
    			CreateCompositionLoader(createComposition09_doctor_BG,		                'front',		    0,0, 20, 512,384, true),
    			CreateCompositionLoader(createCompositionback_compos,		                'back',		        0,0, 1, 512,384,  true),
		},
		{
			function (element, textureName)
				if textureName == "glow.JPG" then
					local anim = element:GetTexture()
					anim:SetBlendMode(0)
					return
				end
				if textureName == "Mus[].png" then
					local anim = element:GetTexture()
					anim:SetFrames(2)
					anim:SetTextureRect(0,0,38,95)
					anim:SetSpeed(24)
					anim:SetMode(HGEANIM_FWD + HGEANIM_LOOP)
					anim:Play()
				end
				if textureName == "piluka.png" then
					local anim = element:GetTexture()
					anim:SetBlendMode(0)
					return
				end
				if textureName == "svechka_svet_copy.PNG" then
					local anim = element:GetTexture()
					anim:SetBlendMode(0)
					return
				end
			end,
		});
end
---------------------------------------------------------------------------------------
createComposition09_doctor_BG = function()
	local composition09_doctor_BG = CreateCompositionSequence()
	local compositionDuration = 8
	composition09_doctor_BG:SetDuration(compositionDuration)
 
	local element
	local effector
 
	-- Layer Layer_1
	element = createCompositionPilka()
	element:SetName("Layer_1")
	composition09_doctor_BG:AddElement(element)
	element:SetHotSpot(512, 384)
	element:SetParentElement(composition09_doctor_BG)
	element:SetXY(512, 384)
 
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:Play()
 
 
	-- Layer Layer_2
	element = CreateCompositionElement(PREFIX_PATH.."glow.JPG")
	element:SetName("Layer_2")
	composition09_doctor_BG:AddElement(element)
	element:SetHotSpot(52, 31.5)
	element:SetParentElement(composition09_doctor_BG)
	element:SetXY(696.25, 256)
 
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:SetKey(_TRACK_O, 0, 0)
	effector:SetKey(_TRACK_O, 1.5, 0.375)
	effector:SetKey(_TRACK_O, 2, 0.42135592832404)
	effector:SetKey(_TRACK_O, 2.5, 0.375)
	effector:SetKey(_TRACK_O, 3.5, 0.125)
	effector:SetKey(_TRACK_O, 4, 0.06389827146369)
	effector:SetKey(_TRACK_O, 4.5, 0.125)
	effector:SetKey(_TRACK_O, 5.5, 0.375)
	effector:SetKey(_TRACK_O, 6, 0.42135592832404)
	effector:SetKey(_TRACK_O, 6.5, 0.37234042553191)
	effector:SetKey(_TRACK_O, 7.95833333333333, 0)
	effector:Play()
 
 
	-- Layer Layer_3
	element = CreateCompositionElement(PREFIX_PATH.."svechka_svet_copy.PNG")
	element:SetName("Layer_3")
	composition09_doctor_BG:AddElement(element)
	element:SetHotSpot(95.5, 80.5)
	composition09_doctor_BG:RegisterParentInfo("Layer_3", "Layer_4")
	element:SetXY(55.2258548490524, 164.995924443692)
 
	element:SetAngle(0.00459438071601)
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:SetKey(_TRACK_O, 0, 0.91902888926766)
	effector:SetKey(_TRACK_O, 0.08333333333333, 1)
	effector:SetKey(_TRACK_O, 0.45833333333333, 1)
	effector:SetKey(_TRACK_O, 0.625, 0.96205718498844)
	effector:SetKey(_TRACK_O, 0.70833333333333, 1)
	effector:SetKey(_TRACK_O, 0.83333333333333, 0.9768491805317)
	effector:SetKey(_TRACK_O, 0.95833333333333, 0.99284204380441)
	effector:SetKey(_TRACK_O, 1, 0.95098068162471)
	effector:SetKey(_TRACK_O, 1.04166666666667, 1)
	effector:SetKey(_TRACK_O, 1.125, 0.93341902742419)
	effector:SetKey(_TRACK_O, 1.16666666666667, 0.9865756938804)
	effector:SetKey(_TRACK_O, 1.33333333333333, 0.98668449190616)
	effector:SetKey(_TRACK_O, 1.375, 1)
	effector:SetKey(_TRACK_O, 1.5, 0.99158989178747)
	effector:SetKey(_TRACK_O, 1.54166666666667, 0.97943182538582)
	effector:SetKey(_TRACK_O, 1.58333333333333, 0.94995560488291)
	effector:SetKey(_TRACK_O, 1.66666666666667, 1)
	effector:SetKey(_TRACK_O, 1.70833333333333, 0.94500247379002)
	effector:SetKey(_TRACK_O, 2, 1)
	effector:SetKey(_TRACK_O, 2.125, 0.93373100604839)
	effector:SetKey(_TRACK_O, 2.16666666666667, 0.96399252771328)
	effector:SetKey(_TRACK_O, 2.25, 1)
	effector:SetKey(_TRACK_O, 2.5, 0.98003172294291)
	effector:SetKey(_TRACK_O, 2.54166666666667, 1)
	effector:SetKey(_TRACK_O, 2.625, 0.98737539978287)
	effector:SetKey(_TRACK_O, 2.66666666666667, 1)
	effector:SetKey(_TRACK_O, 2.70833333333333, 0.97960124870718)
	effector:SetKey(_TRACK_O, 2.75, 1)
	effector:SetKey(_TRACK_O, 2.83333333333333, 0.97342291401475)
	effector:SetKey(_TRACK_O, 2.91666666666667, 0.991392999835)
	effector:SetKey(_TRACK_O, 2.95833333333333, 1)
	effector:SetKey(_TRACK_O, 3.08333333333333, 0.94926058335399)
	effector:SetKey(_TRACK_O, 3.125, 0.9387401606433)
	effector:SetKey(_TRACK_O, 3.16666666666667, 1)
	effector:SetKey(_TRACK_O, 3.41666666666667, 0.96544654980134)
	effector:SetKey(_TRACK_O, 3.66666666666667, 1)
	effector:SetKey(_TRACK_O, 3.75, 0.97447118685679)
	effector:SetKey(_TRACK_O, 3.79166666666667, 0.9528579109717)
	effector:SetKey(_TRACK_O, 3.91666666666667, 0.9914113537807)
	effector:SetKey(_TRACK_O, 3.95833333333333, 1)
	effector:SetKey(_TRACK_O, 4, 0.98463481246352)
	effector:SetKey(_TRACK_O, 4.04166666666667, 1)
	effector:SetKey(_TRACK_O, 4.125, 0.93586258138876)
	effector:SetKey(_TRACK_O, 4.16666666666667, 0.98079757514435)
	effector:SetKey(_TRACK_O, 4.25, 0.96848337206083)
	effector:SetKey(_TRACK_O, 4.29166666666667, 0.92040149151629)
	effector:SetKey(_TRACK_O, 4.33333333333333, 0.95775535820749)
	effector:SetKey(_TRACK_O, 4.375, 1)
	effector:SetKey(_TRACK_O, 4.5, 0.96718438054518)
	effector:SetKey(_TRACK_O, 4.58333333333333, 1)
	effector:SetKey(_TRACK_O, 4.66666666666667, 0.95063782863333)
	effector:SetKey(_TRACK_O, 4.70833333333333, 0.94013129093666)
	effector:SetKey(_TRACK_O, 4.75, 0.99314375163758)
	effector:SetKey(_TRACK_O, 5.33333333333333, 0.99068913381166)
	effector:SetKey(_TRACK_O, 5.58333333333333, 1)
	effector:SetKey(_TRACK_O, 5.625, 0.98539108338738)
	effector:SetKey(_TRACK_O, 5.66666666666667, 1)
	effector:SetKey(_TRACK_O, 5.70833333333333, 0.96814333219905)
	effector:SetKey(_TRACK_O, 5.79166666666667, 0.92119471686603)
	effector:SetKey(_TRACK_O, 5.83333333333333, 0.98962329702087)
	effector:SetKey(_TRACK_O, 5.875, 1)
	effector:SetKey(_TRACK_O, 5.91666666666667, 0.96142515576772)
	effector:SetKey(_TRACK_O, 6.04166666666667, 1)
	effector:SetKey(_TRACK_O, 6.20833333333333, 0.98142872409321)
	effector:SetKey(_TRACK_O, 6.375, 1)
	effector:SetKey(_TRACK_O, 6.41666666666667, 0.96998678415148)
	effector:SetKey(_TRACK_O, 6.45833333333333, 1)
	effector:SetKey(_TRACK_O, 6.5, 0.99087425521875)
	effector:SetKey(_TRACK_O, 6.54166666666667, 0.92476442723608)
	effector:SetKey(_TRACK_O, 6.66666666666667, 1)
	effector:SetKey(_TRACK_O, 6.70833333333333, 0.9666857125329)
	effector:SetKey(_TRACK_O, 6.75, 0.95736149626849)
	effector:SetKey(_TRACK_O, 6.91666666666667, 0.98207279881273)
	effector:SetKey(_TRACK_O, 7.375, 1)
	effector:SetKey(_TRACK_O, 7.41666666666667, 0.98021419622944)
	effector:SetKey(_TRACK_O, 7.45833333333333, 1)
	effector:SetKey(_TRACK_O, 7.5, 0.99270821955691)
	effector:SetKey(_TRACK_O, 7.625, 0.94101115225865)
	effector:SetKey(_TRACK_O, 7.66666666666667, 0.99465756323745)
	effector:SetKey(_TRACK_O, 7.95833333333333, 1)
	effector:Play()
 
 
	-- Layer Layer_4
	element = CreateCompositionElement(PREFIX_PATH.."lamp.PNG")
	element:SetName("Layer_4")
	composition09_doctor_BG:AddElement(element)
	element:SetHotSpot(56.5, -3.5)
	element:SetParentElement(composition09_doctor_BG)
	element:SetXY(436.5, -4.5)
 
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:SetKey(_TRACK_A, 0, 0.034906585)
	effector:SetKey(_TRACK_A, 0.75, -0.0174532925)
	effector:SetKey(_TRACK_A, 1, -0.02737325366781)
	effector:SetKey(_TRACK_A, 1.25, -0.0174532925)
	effector:SetKey(_TRACK_A, 1.75, 0.0174532925)
	effector:SetKey(_TRACK_A, 2, 0.02737325366781)
	effector:SetKey(_TRACK_A, 2.25, 0.0174532925)
	effector:SetKey(_TRACK_A, 2.75, -0.0174532925)
	effector:SetKey(_TRACK_A, 3, -0.02737325366781)
	effector:SetKey(_TRACK_A, 3.25, -0.01708194585106)
	effector:SetKey(_TRACK_A, 3.625, 0.0110150757028)
	effector:SetKey(_TRACK_A, 3.95833333333333, 0.02737325474572)
	effector:SetKey(_TRACK_A, 4.29166666666667, 0.01203386508959)
	effector:SetKey(_TRACK_A, 4.70833333333333, -0.0174532925)
	effector:SetKey(_TRACK_A, 4.95833333333333, -0.02737325366781)
	effector:SetKey(_TRACK_A, 5.20833333333333, -0.0174532925)
	effector:SetKey(_TRACK_A, 5.70833333333333, 0.0174532925)
	effector:SetKey(_TRACK_A, 5.95833333333333, 0.02737325366781)
	effector:SetKey(_TRACK_A, 6.20833333333333, 0.0174532925)
	effector:SetKey(_TRACK_A, 6.70833333333333, -0.0174532925)
	effector:SetKey(_TRACK_A, 7, -0.02737325366781)
	effector:SetKey(_TRACK_A, 7.20833333333333, -0.01708194585106)
	effector:SetKey(_TRACK_A, 7.95833333333333, 0.034906585)
	effector:Play()
 
 
	-- Layer Layer_5
	element = CreateCompositionElement(PREFIX_PATH.."Mus[].png")
	element:SetName("Layer_5")
	composition09_doctor_BG:AddElement(element)
	element:SetHotSpot(19, 47.5)
	element:SetParentElement(composition09_doctor_BG)
	element:SetAngle(-1.1344640125)
 
	effector = element:GetEffector()
	effector:SetLifeTime(2.70833333333333, 5.20833333333333)
	effector:SetKey(_TRACK_X, 2.70833333333333, 534)
	effector:SetKey(_TRACK_Y, 2.70833333333333, 795)
	effector:SetKey(_TRACK_X, 5.20833333333333, -37)
	effector:SetKey(_TRACK_Y, 5.20833333333333, 584)
	effector:SetKey(_TRACK_SX, 2.70833333333333, 0.8)
	effector:SetKey(_TRACK_SY, 2.70833333333333, 0.8)
	effector:SetKey(_TRACK_SX, 5.20833333333333, 0.75)
	effector:SetKey(_TRACK_SY, 5.20833333333333, 0.75)
	effector:Play()
 
	composition09_doctor_BG:Play()
 
	return composition09_doctor_BG
end
 
createCompositionback_compos = function()
	local compositionback_compos = CreateCompositionSequence()
	local compositionDuration = 8
	compositionback_compos:SetDuration(compositionDuration)
 
	local element
	local effector
 
	-- Layer Layer_1
	element = CreateCompositionElement(PREFIX_PATH.."bg_svet.JPG")
	element:SetName("Layer_1")
	compositionback_compos:AddElement(element)
	element:SetHotSpot(512, 384)
	element:SetParentElement(compositionback_compos)
	element:SetXY(512, 384)
 
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:SetKey(_TRACK_O, 0, 0)
	effector:SetKey(_TRACK_O, 1, 0.78)
	effector:SetKey(_TRACK_O, 2, 0)
	effector:SetKey(_TRACK_O, 3, 0.78)
	effector:SetKey(_TRACK_O, 3.95833333333333, 0)
	effector:SetKey(_TRACK_O, 4.95833333333333, 0.78)
	effector:SetKey(_TRACK_O, 5.95833333333333, 0)
	effector:SetKey(_TRACK_O, 7, 0.78)
	effector:SetKey(_TRACK_O, 7.95833333333333, 0)
	effector:Play()
 
	compositionback_compos:Play()
 
	return compositionback_compos
end
 
createCompositionPilka = function()
	local compositionPilka = CreateCompositionSequence()
	local compositionDuration = 8
	compositionPilka:SetDuration(compositionDuration)
 
	local element
	local effector
 
	-- Layer Layer_1
	element = createCompositionpiluka()
	element:SetName("Layer_1")
	compositionPilka:AddElement(element)
	element:SetHotSpot(320, 240)
	element:SetParentElement(compositionPilka)
	element:SetXY(205, 354)
 
	element:SetScaleX(-1.01)
	element:SetScaleY(1.0289375)
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:Play()
 
 
	-- Layer Layer_2
	element = createCompositionpiluka()
	element:SetName("Layer_2")
	compositionPilka:AddElement(element)
	element:SetHotSpot(320, 240)
	element:SetParentElement(compositionPilka)
	element:SetXY(205, 354)
 
	element:SetScaleX(-1.01)
	element:SetScaleY(1.0289375)
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:Play()
 
 
	-- Layer Layer_3
	element = createCompositionpiluka()
	element:SetName("Layer_3")
	compositionPilka:AddElement(element)
	element:SetHotSpot(320, 240)
	element:SetParentElement(compositionPilka)
	element:SetXY(479, 422)
 
	element:SetScaleX(-1.83)
	element:SetScaleY(1.8643125)
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:Play()
 
 
	-- Layer Layer_4
	element = createCompositionpiluka()
	element:SetName("Layer_4")
	compositionPilka:AddElement(element)
	element:SetHotSpot(320, 240)
	element:SetParentElement(compositionPilka)
	element:SetXY(494, 374)
 
	element:SetScaleX(1.63)
	element:SetScaleY(1.63)
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:Play()
 
 
	-- Layer Layer_5
	element = createCompositionpiluka()
	element:SetName("Layer_5")
	compositionPilka:AddElement(element)
	element:SetHotSpot(320, 240)
	element:SetParentElement(compositionPilka)
	element:SetXY(436, 168)
 
	element:SetScaleX(0.55)
	element:SetScaleY(0.55)
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:Play()
 
 
	-- Layer Layer_6
	element = createCompositionpiluka()
	element:SetName("Layer_6")
	compositionPilka:AddElement(element)
	element:SetHotSpot(320, 240)
	element:SetParentElement(compositionPilka)
	element:SetXY(436, 168)
 
	element:SetScaleX(0.55)
	element:SetScaleY(0.55)
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:Play()
 
	compositionPilka:Play()
 
	return compositionPilka
end
 
createCompositionpiluka = function()
	local compositionpiluka = CreateCompositionSequence()
	local compositionDuration = 8
	compositionpiluka:SetDuration(compositionDuration)
 
	local element
	local effector
 
	-- Layer Layer_1
	element = CreateCompositionElement(PREFIX_PATH.."piluka.png")
	element:SetName("Layer_1")
	compositionpiluka:AddElement(element)
	element:SetHotSpot(320, 240)
	element:SetParentElement(compositionpiluka)
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:SetKey(_TRACK_X, 0, 332.88456758836)
	effector:SetKey(_TRACK_Y, 0, 228.910974877944)
	effector:SetKey(_TRACK_X, 7.95833333333333, 121)
	effector:SetKey(_TRACK_Y, 7.95833333333333, 212)
	effector:SetKey(_TRACK_SX, 0, 1.18094240837696)
	effector:SetKey(_TRACK_SY, 0, 1.18094240837696)
	effector:SetKey(_TRACK_SX, 7.95833333333333, 1.36)
	effector:SetKey(_TRACK_SY, 7.95833333333333, 1.36)
	effector:SetKey(_TRACK_O, 0, 1)
	effector:SetKey(_TRACK_O, 7.95833333333333, 0)
	effector:Play()
 
 
	-- Layer Layer_2
	element = CreateCompositionElement(PREFIX_PATH.."piluka.png")
	element:SetName("Layer_2")
	compositionpiluka:AddElement(element)
	element:SetHotSpot(320, 240)
	element:SetParentElement(compositionpiluka)
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 8)
	effector:SetKey(_TRACK_X, 0, 547)
	effector:SetKey(_TRACK_Y, 0, 246)
	effector:SetKey(_TRACK_X, 7.95833333333333, 332.88456758836)
	effector:SetKey(_TRACK_Y, 7.95833333333333, 228.910974877944)
	effector:SetKey(_TRACK_SX, 0, 1)
	effector:SetKey(_TRACK_SY, 0, 1)
	effector:SetKey(_TRACK_SX, 7.95833333333333, 1.18094240837696)
	effector:SetKey(_TRACK_SY, 7.95833333333333, 1.18094240837696)
	effector:SetKey(_TRACK_O, 0, 0)
	effector:SetKey(_TRACK_O, 7.95833333333333, 1)
	effector:Play()
 
	compositionpiluka:Play()
 
	return compositionpiluka
end
 
