--local movie = nil
--local comp = nil

function OnSceneLoad(screen)
	movie = screen
    game_state = {}    
    LoadData(screen)        
    --level:AddTaskSafe(CreateTask('', '', ''))
    --zone = CreateZoomZone('')    
	game_state.custom_cursors = {}
	
	game_state.level_to_load_on_finish = nil
	game_state.locked_objects = {}
	game_state.locker = ReferenceCounter()
    game_state.active_zone = nil
	
	local sheriff_drinking = screen:GetObject('sh_chay'):GetAnimation()
	--sheriff_drinking:SetMode(HGEANIM_FWD + HGEANIM_NOLOOP)
	sheriff_drinking:Stop()
	local sheriff_talking = screen:GetObject('sh_govorit'):GetAnimation()
	sheriff_talking.sound = CreateSoundEntity('SheriffTalking')
	sheriff_talking.sound:AttachTo(screen)	
	--sheriff_talking:SetMode(HGEANIM_FWD + HGEANIM_NOLOOP)
	sheriff_talking:Stop()
	local kid_talking = screen:GetObject('sin_talk'):GetAnimation()
	kid_talking.sound = CreateSoundEntity('KidTalking')
	kid_talking.sound:AttachTo(screen)	
	--kid_talking:SetMode(HGEANIM_FWD + HGEANIM_NOLOOP)
	kid_talking:Stop()
	local wife_talking = screen:GetObject('zenka'):GetAnimation()
	wife_talking.sound = CreateSoundEntity('WifeTalking')
	wife_talking.sound:AttachTo(screen)	
	--wife_talking:SetMode(HGEANIM_FWD + HGEANIM_NOLOOP)
	wife_talking:Stop()
	local news_reader = screen:GetObject('NewsReader2'):GetAnimation()
	--news_reader:SetMode(HGEANIM_FWD + HGEANIM_NOLOOP)
	screen:GetObject('pomex'):SetOpacity(0)
	local pomex_anim = screen:GetObject('pomex'):GetAnimation()
	pomex_anim:SetMode(HGEANIM_FWD + HGEANIM_NOLOOP)
	pomex_anim:Stop()
	news_reader:Stop()
	news_reader.sound = CreateSoundEntity('KidTalking')
	news_reader.sound:AttachTo(screen)	
	
	local channel_switch = screen:GetObject('pomex')
	channel_switch.sound = CreateSoundEntity('ChannelSwitch')
	channel_switch.sound:AttachTo(screen)
	screen:GetObject('NewsReader2'):SetOpacity(0)
    screen:GetObject('tv'):SetOpacity(0)
	    
	local te = CreateTextEntity("Comics", "")
	te:SetXY(20, 40)
	te:SetZ(1)
	te:SetTextAlignment(HGETEXT_TOP + HGETEXT_LEFT)
	te:AttachTo(movie:GetObject('Bubble'))
	
	te:SetOpacity(0)
	movie.text = te
	
	screen:GetObject('Bubble'):SetOpacity(0)
	
	PushMovieInfo('Museum',
				  'data/Scenes/1_museum_gallery_1.lua',
				  {
					{anim = kid_talking; text = 'MOVIE_1_1'};
					{anim = wife_talking; text = 'MOVIE_1_2'};
					{anim = news_reader;
					 anim_secondary = channel_switch;
                     text = 'MOVIE_1_3';
                     change_opacity = true;
                     object=screen:GetObject('NewsReader2');
                     sound_volume=0.5};
					{anim = nil;
					 text = 'MOVIE_1_4';
					 callback=function()					    
					    comp = CreateTVComposition()
					    comp:SetDestroysOnEnd(false)
                        comp:AttachTo(screen);
                        comp:SetXY(629, 333);
                        comp:SetClippingRect(629 - 325, 333 - 240, 670, 480)
                        comp:SetZ(200);
                        local af = CreateAnimationEffector()
                        af:AttachTo(comp)
                        af:SetKey(_TRACK_O, 0, 0)
                        af:SetKey(_TRACK_O, 1, 1)
                        af:Play()
                        local af = CreateAnimationEffector()
                        af:AttachTo(movie:GetObject('tv'))
                        af:SetKey(_TRACK_O, 0, 0)
                        af:SetKey(_TRACK_O, 1, 1)
                        af:Play()
                        comp.sound = CreateSoundEntity('MuseumDirector')
                        comp.sound:AttachTo(screen)
                        comp.sound:Play(true)
                        news_reader.sound:SetVolume(1)
                        news_reader.sound:StopSound()

						--comp:Play()
					 end};
                    {anim = news_reader; text = 'MOVIE_1_5'; change_opacity = true; object=screen:GetObject('NewsReader2'); sound_volume=0.5};
					{anim = sheriff_talking; text = 'MOVIE_1_6'} 
				  });
    PushMovieInfo('PoliceStation',
				  'data/Scenes/3_sheriff_cabinet_2.lua',
				  {
					{anim = sheriff_talking; text = 'MOVIE_2_1'};
					{anim = wife_talking; text = 'MOVIE_2_2'}				
				  });
    PushMovieInfo('Service',
				  'data/Scenes/6_cabinet_chief_repair_3.lua',
				  {
					{anim = kid_talking; text = 'MOVIE_3_1'};
					{anim = sheriff_talking; text = 'MOVIE_3_2'};
					{anim = wife_talking; text = 'MOVIE_3_3'}; 
					{anim = sheriff_talking; text = 'MOVIE_3_4'} 
				  });
    PushMovieInfo('PhoneStation',
				  'data/Scenes/9_ room_telephone_operator_4.lua',
				  {
					{anim = sheriff_talking; text = 'MOVIE_4_1'};
					{anim = wife_talking; text = 'MOVIE_4_2'}; 
					{anim = sheriff_talking; text = 'MOVIE_4_3'} 
				  });
    PushMovieInfo('Prison',
				  'data/Scenes/11_call_box_5.lua',
				  {
					{anim = wife_talking; text = 'MOVIE_5_1'}; 
					{anim = sheriff_talking; text = 'MOVIE_5_2'};
					{anim = kid_talking; text = 'MOVIE_5_3'};
					{anim = sheriff_talking; text = 'MOVIE_5_4'} 
				  });
    PushMovieInfo('Pharmacy',
				  'data/Scenes/14_ pharmacy_counter_6.lua',
				  {
					{anim = kid_talking; text = 'MOVIE_6_1'};
					{anim = sheriff_talking; text = 'MOVIE_6_2'};
					{anim = wife_talking; text = 'MOVIE_6_3'}
				  });
	PushMovieInfo('CooksHouse',
				  'data/Scenes/16_ room_helper_7.lua',
				  {
					{anim = wife_talking; text = 'MOVIE_7_1'};
					{anim = sheriff_talking; text = 'MOVIE_7_2'};
					{anim = wife_talking; text = 'MOVIE_7_3'}
				  });
	PushMovieInfo('GasStation',
				  'data/Scenes/18_gas_station_8.lua',
				  {
					{anim = wife_talking; text = 'MOVIE_8_1'}; 
					{anim = sheriff_talking; text = 'MOVIE_8_2'};
					{anim = wife_talking; text = 'MOVIE_8_3'}; 
					{anim = sheriff_talking; text = 'MOVIE_8_4'} 
				  });
	PushMovieInfo('Bar',
				  'data/Scenes/20_bar_proof_9.lua',
				  {
					{anim = wife_talking; text = 'MOVIE_9_1'}; 
					{anim = sheriff_talking; text = 'MOVIE_9_2'};
					{anim = wife_talking; text = 'MOVIE_9_3'}; 
					{anim = sheriff_talking; text = 'MOVIE_9_4'} 
				  });
	PushMovieInfo('JunkYard',
				  'data/Scenes/23_ dump_cars_10.lua',
				  {
					{anim = wife_talking; text = 'MOVIE_10_1'}; 
					{anim = sheriff_talking; text = 'MOVIE_10_2'};
					{anim = wife_talking; text = 'MOVIE_10_3'}
				  });
	PushMovieInfo('AbaddonedHouse',
				  'data/Scenes/26_ garret_11.lua',
				  {
					{anim = wife_talking; text = 'MOVIE_11_1'}; 
					{anim = sheriff_talking; text = 'MOVIE_11_2'};
					{anim = wife_talking; text = 'MOVIE_11_3'}
				  });
	PushMovieInfo('Library',
				  'data/Scenes/29_reception_12.lua',
				  {
					{anim = wife_talking; text = 'MOVIE_12_1'}; 
					{anim = sheriff_talking; text = 'MOVIE_12_2'};
					{anim = wife_talking; text = 'MOVIE_12_3'}; 
					{anim = sheriff_talking; text = 'MOVIE_12_4'} 
				  });
	PushMovieInfo('Cathedral',
				  'data/Scenes/32_cathedral_13.lua',
				  {
					{anim = wife_talking; text = 'MOVIE_13_1'}; 
					{anim = sheriff_talking; text = 'MOVIE_13_2'};
					{anim = wife_talking; text = 'MOVIE_13_3'}; 
					{anim = sheriff_talking; text = 'MOVIE_13_4'} 
				  });
	PushMovieInfo('RaphaelsHouse',
				  'data/Scenes/35_ pond_14.lua',
				  {					
					{anim = sheriff_talking; text = 'MOVIE_14_1'};
					{anim = wife_talking; text = 'MOVIE_14_2'}; 
					{anim = sheriff_talking; text = 'MOVIE_14_3'};
					{anim = wife_talking; text = 'MOVIE_14_4'}; 
					{anim = sheriff_talking; text = 'MOVIE_14_5'};
					{anim = wife_talking; text = 'MOVIE_14_6'}; 
					{anim = sheriff_talking; text = 'MOVIE_14_7'} 
				  });
	
	for i, info in ipairs(game_state.movies) do
        if not info.completed then
            game_state.scenario = info.scenario
            break;
        end
    end	
	
	PlayAnimationPeriodically('osminog', 3, screen);
	
	local pm = GetProfileManager();
	local currentProfile = pm:GetCurrentProfile();	
	currentProfile.level_to_load_ = "map"
	GetProfileManager():SaveProfiles()    
	
	local ProceedHint = CreateTextEntity("Comics", GetString("PRESS_ANY_KEY"))
	ProceedHint:AttachTo(screen)
	ProceedHint:SetXY(571, 754)
	ProceedHint:SetScale(0.5)
	ProceedHint:SetZ(2000)
	local af = CreateAnimationEffector()
	af:AttachTo(ProceedHint)
	af:SetMode(_ANIM_PINGPONG)
	af:SetKey(_TRACK_O, 0, 0)
	af:SetKey(_TRACK_O, 1, 1)
	af:Play()
	
	AddAnimatedEyesLogic(screen, 'she_eye', 3, 5, HGEANIM_FWD + HGEANIM_LOOP, 2)
	AddAnimatedEyesLogic(screen, 'he_eye', 4, 6, HGEANIM_FWD + HGEANIM_NOLOOP)
	AddAnimatedEyesLogic(screen, 'baby_eye', 5, 6, HGEANIM_FWD + HGEANIM_NOLOOP)
end

function HideTV()
	local af = CreateAnimationEffector()
	af:AttachTo(comp)
	af:SetKey(_TRACK_O, 0, 1)
	af:SetKey(_TRACK_O, 1, 0)
	af:Play()
	local af = CreateAnimationEffector()
    af:AttachTo(movie:GetObject('tv'))
    af:SetKey(_TRACK_O, 1, 0)
    af:SetKey(_TRACK_O, 0, 1)
    af:Play()
    comp.sound:StopSound()
	comp = nil
end

function PushMovieInfo(node_name, path, scenario)
	if game_state.movies == nil then
        game_state.movies = {};
    end
    
    local index = table.getn(game_state.movies) + 1;
	
	for k, w in ipairs(scenario) do
	    local v = movie.text:ExplodeText(GetString(w.text), 780, 100)
		movie.text:SetBorderSize(780, 100)
        w.substrings = {}
        for i = 0, v:size() - 1 do
            table.insert(w.substrings, v:get(i))	
        end
        w.currentblock = 1
	end	
    
    game_state.movies[index]           = {}
    game_state.movies[index].path      = path;
    game_state.movies[index].name      = node_name;
	game_state.movies[index].scenario  = scenario
	
	
    local completed = false
	if GetProfileManager():GetCurrentProfile().last_level_completed_ ~= "" then
	    completed = IsLevelCompleted(path)
	end
    game_state.movies[index].completed =  completed;
end

function OnSceneFree(screen)
    FreeData(screen)
end

function OnUpdate(dt)
end

function Proceed()
    if game_state.current_replic > 1 then        
	    local prev_replic = game_state.scenario[game_state.current_replic - 1]
        if prev_replic.anim and prev_replic.anim:IsPlaying() then
            prev_replic.anim:Stop()
			if prev_replic.anim.sound then
				prev_replic.anim.sound:StopSound()
				prev_replic.anim.sound:SetVolume(1)
			end
            prev_replic.anim:SetFrame(0)
        end
        if prev_replic.callback and comp then            
			HideTV()		
        end
	end

	local replic = game_state.scenario[game_state.current_replic]
	if not replic then
		movie:ScreenDestroy()
		load_screen('data/Lua/Screens/GlobalMap.lua')
		return
	end
	
	if replic.anim then
		if replic.change_opacity then
			replic.object:SetOpacity(1)
		end		
	    replic.anim:Play()	
		if replic.anim.sound then
		    if replic.sound_volume then
		        replic.anim.sound:SetVolume(replic.sound_volume)
		    else
		        replic.anim.sound:SetVolume(1)
		    end
			replic.anim.sound:Play(true)
		end
	    if replic.anim_secondary then
	        replic.anim_secondary:ChangeOpacity(1, 0, 1)
	        replic.anim_secondary:GetAnimation():Play()
	        if replic.anim_secondary.sound then
				replic.anim_secondary.sound:Play(false)
			end
	        replic.anim_secondary = nil
	    end
	else
		if replic.callback and not comp then
			replic.callback()
		end
	end
	if replic.currentblock == 1 then
        --replic.anim:SetColor('0xFFFFFFFF')
        movie:GetObject('Bubble'):ChangeOpacity(0, 1, ZOOM_ZONE_APPEARING_TIME)
        movie.text:ChangeOpacity(0, 1, ZOOM_ZONE_APPEARING_TIME)
        movie.text:SetText(replic.substrings[replic.currentblock])
	else
	    movie.text:SetText(replic.substrings[replic.currentblock])
	end
	replic.currentblock = replic.currentblock + 1
	if replic.currentblock > table.getn(replic.substrings) then
	    if replic.anim and replic.callback then
		    replic.callback()
		end
	    game_state.current_replic = game_state.current_replic + 1			
	end	
end

function OnScreenShown()
	local replic = game_state.scenario[1]
	game_state.current_replic = 1
	--replic.anim:SetColor('0xFFFFFFFF')
	replic.anim:Play()
	if replic.anim.sound then
	    replic.anim.sound:Play(true)
	end
	movie:GetObject('Bubble'):ChangeOpacity(0, 1, ZOOM_ZONE_APPEARING_TIME)
	movie.text:ChangeOpacity(0, 1, ZOOM_ZONE_APPEARING_TIME)
	movie.text:SetText(replic.substrings[replic.currentblock])

    replic.currentblock = replic.currentblock + 1
    if replic.currentblock > table.getn(replic.substrings) then
	   game_state.current_replic = game_state.current_replic + 1 
	end	
end

function OnExit()
end

function OnMinigameCompleted()
end

function OnObjectMouseEnter(object)
    DefaultOnObjectMouseEnter(object)
end

function OnObjectMouseLeave(object)
    DefaultOnObjectMouseLeave(object)
end

function OnObjectMouseDown(object)
    obj_name = object:GetName()
    --local pf = play_field
    local is_wrong_click = true

    --is_wrong_click = DefaultOnObjectMouseDown(object)

    if is_wrong_click then
        --pf:ShowWrongObjectEffect()
    end
	
	--if not game_state.scenario[game_state.current_replic - 1].anim:IsPlaying() then
		
	Proceed()	
	
    return is_wrong_click;    
end

function OnObjectMouseUp(object)
end

function OnObjectWillBeFound(object)
end

function OnToolFound(tool)
end

function OnToolApply(tool, object)
    DefaultOnToolApply(tool, object)
end

function OnObjectReachPanel(object)
end

function OnButtonPress(title)
    DefaultOnButtonPress(title)
end

function OnMouseMove(previous_pos, current_pos)
end

function OnSetTool(tool)
end


function OnLostFocus()
end

function OnGainFocus()
end

function CanBeHinted(obj)
    if locked_object[obj] ~= true then
        return true
    else
        return false
    end
end

function CreateTVComposition()
    createCompositiondir_museya_cycle = function()
    
        local compositiondir_museya_cycle = CreateCompositionSequence();
        local compositionDuration = 7.04;
        compositiondir_museya_cycle:SetDuration(compositionDuration);
    
        -- Layer Layer_1
        local element = CreateCompositionElement("data/Texture/Movie/TV/eye.png");
        element:SetName("Layer_1");
        compositiondir_museya_cycle:AddElement(element);
        element:SetHotSpot(31.5, 30.5);
        compositiondir_museya_cycle:RegisterParentInfo("Layer_1", "Layer_2");
        element:SetXY(167.226565730993, 222.248177571004);
    
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetAngle(-0.00694603013728);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 7.04);
    
        effector:SetKey(_TRACK_O, 0, 0);
        effector:SetKey(_TRACK_O, 0.68, 0);
        effector:SetKey(_TRACK_O, 0.76, 1);
        effector:SetKey(_TRACK_O, 1, 0);
        effector:SetKey(_TRACK_O, 2.88, 0);
        effector:SetKey(_TRACK_O, 2.96, 1);
        effector:SetKey(_TRACK_O, 3.2, 0);
        effector:SetKey(_TRACK_O, 3.44, 0);
        effector:SetKey(_TRACK_O, 3.52, 1);
        effector:SetKey(_TRACK_O, 3.76, 0);
        effector:SetKey(_TRACK_O, 5.64, 0);
        effector:SetKey(_TRACK_O, 5.72, 1);
        effector:SetKey(_TRACK_O, 5.96, 0);
        effector:SetKey(_TRACK_O, 7, 0);
    
        effector:Play();
    
    
        -- Layer Layer_2
        local element = CreateCompositionElement("data/Texture/Movie/TV/head.png");
        element:SetName("Layer_2");
        compositiondir_museya_cycle:AddElement(element);
        element:SetHotSpot(87, 207.5);
        compositiondir_museya_cycle:RegisterParentInfo("Layer_2", "Layer_4");
        element:SetXY(214, 45.5);
    
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 7.04);
    
        effector:SetKey(_TRACK_A, 0, 0);
        effector:SetKey(_TRACK_A, 0.1, 0.00405197925148);
        effector:SetKey(_TRACK_A, 0.2, 0.01331363444767);
        effector:SetKey(_TRACK_A, 0.3, 0.02344356503759);
        effector:SetKey(_TRACK_A, 0.4, 0.03010038763559);
        effector:SetKey(_TRACK_A, 0.44, 0.03081816608656);
        effector:SetKey(_TRACK_A, 0.5, 0.03004472681033);
        effector:SetKey(_TRACK_A, 0.6, 0.02492392826496);
        effector:SetKey(_TRACK_A, 0.7, 0.01516270662952);
        effector:SetKey(_TRACK_A, 0.8, 0.00319980961074);
        effector:SetKey(_TRACK_A, 0.9, -0.00773562189366);
        effector:SetKey(_TRACK_A, 1, -0.01613880266933);
        effector:SetKey(_TRACK_A, 1.1, -0.02194915993352);
        effector:SetKey(_TRACK_A, 1.2, -0.02555719021476);
        effector:SetKey(_TRACK_A, 1.3, -0.02737777615988);
        effector:SetKey(_TRACK_A, 1.36, -0.02775708242793);
        effector:SetKey(_TRACK_A, 1.4, -0.02771595706021);
        effector:SetKey(_TRACK_A, 1.5, -0.02634349384331);
        effector:SetKey(_TRACK_A, 1.6, -0.02340395095821);
        effector:SetKey(_TRACK_A, 1.7, -0.01920570363655);
        effector:SetKey(_TRACK_A, 1.8, -0.01405712365813);
        effector:SetKey(_TRACK_A, 1.9, -0.00826659345785);
        effector:SetKey(_TRACK_A, 2, -0.00214252467314);
        effector:SetKey(_TRACK_A, 2.1, 0.00400667661445);
        effector:SetKey(_TRACK_A, 2.2, 0.00987271014951);
        effector:SetKey(_TRACK_A, 2.3, 0.0151471184613);
        effector:SetKey(_TRACK_A, 2.4, 0.01952157392232);
        effector:SetKey(_TRACK_A, 2.5, 0.0226876456607);
        effector:SetKey(_TRACK_A, 2.6, 0.02433697904516);
        effector:SetKey(_TRACK_A, 2.64, 0.02450294430028);
        effector:SetKey(_TRACK_A, 2.7, 0.02433583122653);
        effector:SetKey(_TRACK_A, 2.8, 0.02354206387863);
        effector:SetKey(_TRACK_A, 2.9, 0.02194505340013);
        effector:SetKey(_TRACK_A, 3, 0.01928213538599);
        effector:SetKey(_TRACK_A, 3.1, 0.01515127942486);
        effector:SetKey(_TRACK_A, 3.2, 0.00893355269417);
        effector:SetKey(_TRACK_A, 3.3, -0.00020040692798);
        effector:SetKey(_TRACK_A, 3.4, -0.01252071016502);
        effector:SetKey(_TRACK_A, 3.5, -0.0256408271692);
        effector:SetKey(_TRACK_A, 3.6, -0.03613560051072);
        effector:SetKey(_TRACK_A, 3.7, -0.04340466004321);
        effector:SetKey(_TRACK_A, 3.8, -0.048242160858);
        effector:SetKey(_TRACK_A, 3.9, -0.05137978970058);
        effector:SetKey(_TRACK_A, 4, -0.0533035679329);
        effector:SetKey(_TRACK_A, 4.1, -0.05432772605766);
        effector:SetKey(_TRACK_A, 4.2, -0.05466114408213);
        effector:SetKey(_TRACK_A, 4.3, -0.0543381222663);
        effector:SetKey(_TRACK_A, 4.4, -0.05314290954179);
        effector:SetKey(_TRACK_A, 4.5, -0.05084969323866);
        effector:SetKey(_TRACK_A, 4.6, -0.04714901693095);
        effector:SetKey(_TRACK_A, 4.7, -0.04163004911832);
        effector:SetKey(_TRACK_A, 4.8, -0.03382930560865);
        effector:SetKey(_TRACK_A, 4.9, -0.02355154105982);
        effector:SetKey(_TRACK_A, 5, -0.01169501510147);
        effector:SetKey(_TRACK_A, 5.1, -0.0005213319468);
        effector:SetKey(_TRACK_A, 5.2, 0.008153456242);
        effector:SetKey(_TRACK_A, 5.3, 0.01406936774505);
        effector:SetKey(_TRACK_A, 5.4, 0.01771289182912);
        effector:SetKey(_TRACK_A, 5.5, 0.01962497939757);
        effector:SetKey(_TRACK_A, 5.6, 0.02022438650973);
        effector:SetKey(_TRACK_A, 5.7, 0.02045837298058);
        effector:SetKey(_TRACK_A, 5.8, 0.02027943733359);
        effector:SetKey(_TRACK_A, 5.9, 0.01966424659191);
        effector:SetKey(_TRACK_A, 6, 0.01859841042075);
        effector:SetKey(_TRACK_A, 6.1, 0.01708384322467);
        effector:SetKey(_TRACK_A, 6.2, 0.01514869277689);
        effector:SetKey(_TRACK_A, 6.3, 0.01285897599197);
        effector:SetKey(_TRACK_A, 6.4, 0.01032827351881);
        effector:SetKey(_TRACK_A, 6.5, 0.0077187616639);
        effector:SetKey(_TRACK_A, 6.6, 0.00522810158823);
        effector:SetKey(_TRACK_A, 6.7, 0.00306082807832);
        effector:SetKey(_TRACK_A, 6.8, 0.00139408863235);
        effector:SetKey(_TRACK_A, 6.9, 0.00035236130664);
        effector:SetKey(_TRACK_A, 7, 0);
    
        effector:Play();
    
    
        -- Layer Layer_3
        local element = CreateCompositionElement("data/Texture/Movie/TV/mouth.png");
        element:SetName("Layer_3");
        compositiondir_museya_cycle:AddElement(element);
        element:SetHotSpot(15.5, 17.5);
        compositiondir_museya_cycle:RegisterParentInfo("Layer_3", "Layer_2");
        element:SetXY(200, 285.5);
    
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 7.04);
    
        effector:SetKey(_TRACK_A, 0, 0);
        effector:SetKey(_TRACK_A, 0.1466796875, -0.01794119850085);
        effector:SetKey(_TRACK_A, 0.44, 0.1664494517806);
        effector:SetKey(_TRACK_A, 0.76265625, -0.10135288126207);
        effector:SetKey(_TRACK_A, 0.9386328125, 0.08753864687066);
        effector:SetKey(_TRACK_A, 1.17328125, -0.1162958042539);
        effector:SetKey(_TRACK_A, 1.319921875, 0.27180822418785);
        effector:SetKey(_TRACK_A, 1.4665625, -0.14275405183081);
        effector:SetKey(_TRACK_A, 1.613203125, 0.0855998054294);
        effector:SetKey(_TRACK_A, 1.7598828125, -0.14275405952846);
        effector:SetKey(_TRACK_A, 1.965234375, 0.2718082297085);
        effector:SetKey(_TRACK_A, 2.053203125, -0.15239285859004);
        effector:SetKey(_TRACK_A, 2.1998828125, -0.13866171361621);
        effector:SetKey(_TRACK_A, 2.346484375, 0.04886570352008);
        effector:SetKey(_TRACK_A, 2.4931640625, -0.13971422699797);
        effector:SetKey(_TRACK_A, 2.6398046875, -0.00774151290002);
        effector:SetKey(_TRACK_A, 2.786484375, -0.12605232632557);
        effector:SetKey(_TRACK_A, 2.9331640625, 0.08753864586947);
        effector:SetKey(_TRACK_A, 3.0798046875, -0.19026949147298);
        effector:SetKey(_TRACK_A, 3.24, -0.1162958146329);
        effector:SetKey(_TRACK_A, 3.72, -0.07178807299725);
        effector:SetKey(_TRACK_A, 4.36, -0.04978664961644);
        effector:SetKey(_TRACK_A, 5.08, -0.09710593551274);
        effector:SetKey(_TRACK_A, 5.7259375, -0.10135287292795);
        effector:SetKey(_TRACK_A, 5.938359375, 0.14789890342715);
        effector:SetKey(_TRACK_A, 6.150703125, -0.10135288126207);
        effector:SetKey(_TRACK_A, 6.3630078125, 0.14285099385281);
        effector:SetKey(_TRACK_A, 6.5753515625, -0.12584459342128);
        effector:SetKey(_TRACK_A, 6.7876953125, 0.03847905830538);
        effector:SetKey(_TRACK_A, 6.8938671875, -0.10135288400502);
        effector:SetKey(_TRACK_A, 7, 0);
    
        effector:Play();
    
    
        -- Layer Layer_4
        local element = CreateCompositionElement("data/Texture/Movie/TV/torse1.png");
        element:SetName("Layer_4");
        compositiondir_museya_cycle:AddElement(element);
        element:SetHotSpot(238, 304.5);
        compositiondir_museya_cycle:RegisterParentInfo("Layer_4", "Layer_5");
        element:SetXY(240.5, 130.5);
    
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 7.04);
    
        effector:SetKey(_TRACK_A, 0, 0.01323366940223);
        effector:SetKey(_TRACK_A, 0.125, 0.01226325670686);
        effector:SetKey(_TRACK_A, 0.25, 0.00967663226522);
        effector:SetKey(_TRACK_A, 0.375, 0.00596055638632);
        effector:SetKey(_TRACK_A, 0.5, 0.00160190806795);
        effector:SetKey(_TRACK_A, 0.625, -0.00291255582248);
        effector:SetKey(_TRACK_A, 0.75, -0.00709596515289);
        effector:SetKey(_TRACK_A, 0.875, -0.01046151212283);
        effector:SetKey(_TRACK_A, 1, -0.01252236656589);
        effector:SetKey(_TRACK_A, 1.08, -0.01293181037994);
        effector:SetKey(_TRACK_A, 1.125, -0.01283093748484);
        effector:SetKey(_TRACK_A, 1.25, -0.01159128582726);
        effector:SetKey(_TRACK_A, 1.375, -0.00919372232193);
        effector:SetKey(_TRACK_A, 1.5, -0.00595987034248);
        effector:SetKey(_TRACK_A, 1.625, -0.00221139280009);
        effector:SetKey(_TRACK_A, 1.75, 0.00173007928233);
        effector:SetKey(_TRACK_A, 1.875, 0.0055428783782);
        effector:SetKey(_TRACK_A, 2, 0.00890539515756);
        effector:SetKey(_TRACK_A, 2.125, 0.01149595202911);
        effector:SetKey(_TRACK_A, 2.25, 0.0129929329555);
        effector:SetKey(_TRACK_A, 2.32, 0.01323366683953);
        effector:SetKey(_TRACK_A, 2.375, 0.01291176749993);
        effector:SetKey(_TRACK_A, 2.5, 0.01003287028082);
        effector:SetKey(_TRACK_A, 2.625, 0.00569745963233);
        effector:SetKey(_TRACK_A, 2.75, -0.00002276772153);
        effector:SetKey(_TRACK_A, 2.875, -0.00654096204207);
        effector:SetKey(_TRACK_A, 3, -0.01327045094706);
        effector:SetKey(_TRACK_A, 3.125, -0.01962432479554);
        effector:SetKey(_TRACK_A, 3.25, -0.0250159619866);
        effector:SetKey(_TRACK_A, 3.375, -0.02885848544522);
        effector:SetKey(_TRACK_A, 3.5, -0.03056511537356);
        effector:SetKey(_TRACK_A, 3.52, -0.03060076752799);
        effector:SetKey(_TRACK_A, 3.625, -0.02960156323635);
        effector:SetKey(_TRACK_A, 3.75, -0.02617291287259);
        effector:SetKey(_TRACK_A, 3.875, -0.02092540194173);
        effector:SetKey(_TRACK_A, 4, -0.01450864622155);
        effector:SetKey(_TRACK_A, 4.125, -0.00685065772232);
        effector:SetKey(_TRACK_A, 4.25, 0.00298455558578);
        effector:SetKey(_TRACK_A, 4.375, 0.01169343932611);
        effector:SetKey(_TRACK_A, 4.5, 0.01833724588195);
        effector:SetKey(_TRACK_A, 4.625, 0.02271595926741);
        effector:SetKey(_TRACK_A, 4.68, 0.02321317557654);
        effector:SetKey(_TRACK_A, 4.75, 0.02251270699566);
        effector:SetKey(_TRACK_A, 4.875, 0.02070221097923);
        effector:SetKey(_TRACK_A, 5, 0.01695892759468);
        effector:SetKey(_TRACK_A, 5.125, 0.01210022456357);
        effector:SetKey(_TRACK_A, 5.25, 0.00659082493861);
        effector:SetKey(_TRACK_A, 5.375, 0.00089553267918);
        effector:SetKey(_TRACK_A, 5.5, -0.00452089664155);
        effector:SetKey(_TRACK_A, 5.625, -0.00919371419663);
        effector:SetKey(_TRACK_A, 5.75, -0.01159126601815);
        effector:SetKey(_TRACK_A, 5.875, -0.01283094293908);
        effector:SetKey(_TRACK_A, 5.92, -0.01293182024023);
        effector:SetKey(_TRACK_A, 6, -0.01252238097985);
        effector:SetKey(_TRACK_A, 6.125, -0.01046150048804);
        effector:SetKey(_TRACK_A, 6.25, -0.00709594054332);
        effector:SetKey(_TRACK_A, 6.375, -0.00291254472416);
        effector:SetKey(_TRACK_A, 6.5, 0.00160191972778);
        effector:SetKey(_TRACK_A, 6.625, 0.00596057590228);
        effector:SetKey(_TRACK_A, 6.75, 0.00967663487482);
        effector:SetKey(_TRACK_A, 6.875, 0.01226326972113);
        effector:SetKey(_TRACK_A, 7, 0.01323366940223);
    
        effector:Play();
    
    
        -- Layer Layer_5
        local element = CreateCompositionElement("data/Texture/Movie/TV/torse2.png");
        element:SetName("Layer_5");
        compositiondir_museya_cycle:AddElement(element);
        element:SetHotSpot(251.5, 403.5);
        element:SetParentElement(compositiondir_museya_cycle);
        element:SetXY(180, 477);
    
        element:SetScaleX(0.73);
        element:SetScaleY(0.73);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 7.04);
    
        effector:SetKey(_TRACK_A, 0, -0.00628763926496);
        effector:SetKey(_TRACK_A, 0.1396875, -0.00564466064332);
        effector:SetKey(_TRACK_A, 0.2646875, -0.00441096626348);
        effector:SetKey(_TRACK_A, 0.3896875, -0.00276444925279);
        effector:SetKey(_TRACK_A, 0.5146875, -0.00088303810514);
        effector:SetKey(_TRACK_A, 0.6396875, 0.00105530499979);
        effector:SetKey(_TRACK_A, 0.7646875, 0.00287265898856);
        effector:SetKey(_TRACK_A, 0.8896875, 0.00439106714378);
        effector:SetKey(_TRACK_A, 1.0146875, 0.00543259603615);
        effector:SetKey(_TRACK_A, 1.1396875, 0.00581932813254);
        effector:SetKey(_TRACK_A, 1.2646875, 0.00547914374092);
        effector:SetKey(_TRACK_A, 1.3896875, 0.00455578476461);
        effector:SetKey(_TRACK_A, 1.5146875, 0.00319504448139);
        effector:SetKey(_TRACK_A, 1.6396875, 0.00154274167161);
        effector:SetKey(_TRACK_A, 1.7646875, -0.00025539127636);
        effector:SetKey(_TRACK_A, 1.8896875, -0.00205350205326);
        effector:SetKey(_TRACK_A, 2.0146875, -0.00370582269554);
        effector:SetKey(_TRACK_A, 2.1396875, -0.00506653285224);
        effector:SetKey(_TRACK_A, 2.2646875, -0.00598991721183);
        effector:SetKey(_TRACK_A, 2.3896875, -0.00633008373252);
        effector:SetKey(_TRACK_A, 2.4096875, -0.00634019853569);
        effector:SetKey(_TRACK_A, 2.5146875, -0.00603086881278);
        effector:SetKey(_TRACK_A, 2.6396875, -0.00447909528261);
        effector:SetKey(_TRACK_A, 2.7646875, -0.00212397162771);
        effector:SetKey(_TRACK_A, 2.8896875, 0.00072314670147);
        effector:SetKey(_TRACK_A, 3.0146875, 0.00375083985884);
        effector:SetKey(_TRACK_A, 3.1396875, 0.00664782090637);
        effector:SetKey(_TRACK_A, 3.2646875, 0.00910257305266);
        effector:SetKey(_TRACK_A, 3.3896875, 0.0108037927587);
        effector:SetKey(_TRACK_A, 3.5146875, 0.01144003902495);
        effector:SetKey(_TRACK_A, 3.6396875, 0.0109400690032);
        effector:SetKey(_TRACK_A, 3.7646875, 0.0095829969174);
        effector:SetKey(_TRACK_A, 3.8896875, 0.00758312073238);
        effector:SetKey(_TRACK_A, 4.0146875, 0.00515466551858);
        effector:SetKey(_TRACK_A, 4.1396875, 0.00235998921609);
        effector:SetKey(_TRACK_A, 4.2646875, -0.00188434469979);
        effector:SetKey(_TRACK_A, 4.3896875, -0.00578448443596);
        effector:SetKey(_TRACK_A, 4.5146875, -0.00899641867018);
        effector:SetKey(_TRACK_A, 4.6396875, -0.01117586852033);
        effector:SetKey(_TRACK_A, 4.7646875, -0.01178095326125);
        effector:SetKey(_TRACK_A, 4.8896875, -0.01098889178387);
        effector:SetKey(_TRACK_A, 5.0146875, -0.00930317624965);
        effector:SetKey(_TRACK_A, 5.1396875, -0.00669067969694);
        effector:SetKey(_TRACK_A, 5.2646875, -0.00359338331279);
        effector:SetKey(_TRACK_A, 5.3896875, -0.00033451852786);
        effector:SetKey(_TRACK_A, 5.5146875, 0.00276275052614);
        effector:SetKey(_TRACK_A, 5.6396875, 0.00438942017484);
        effector:SetKey(_TRACK_A, 5.7646875, 0.00551299522238);
        effector:SetKey(_TRACK_A, 5.8896875, 0.00593221828027);
        effector:SetKey(_TRACK_A, 6.0146875, 0.00562290854237);
        effector:SetKey(_TRACK_A, 6.1396875, 0.0047783398704);
        effector:SetKey(_TRACK_A, 6.2646875, 0.00352355888281);
        effector:SetKey(_TRACK_A, 6.3896875, 0.00198365529493);
        effector:SetKey(_TRACK_A, 6.5146875, 0.0002836635032);
        effector:SetKey(_TRACK_A, 6.6396875, -0.0014513503025);
        effector:SetKey(_TRACK_A, 6.7646875, -0.00309630662283);
        effector:SetKey(_TRACK_A, 6.8896875, -0.00452616645998);
        effector:SetKey(_TRACK_A, 7, -0.00628763926496);
    
        effector:Play();
    
        compositiondir_museya_cycle:Play();
    
        return compositiondir_museya_cycle;
    end
    
    createCompositiondirekor_museya = function()
    
        local compositiondirekor_museya = CreateCompositionSequence();
        local compositionDuration = 14.08;
        --compositiondirekor_museya:SetDuration(compositionDuration);
    
        --[[local element = CreateCompositionElement('data/Texture/Movie/TV/tv.png')
        element:SetName("Layer_0");
        compositiondirekor_museya:AddElement(element);
        element:SetHotSpot(324,240)
        element:SetXY(320, 240);]]
        --compositiondirekor_museya:RegisterParentInfo("Layer_0", "Layer_1");
        
        --[[effector = element:GetEffector();
        effector:SetLifeTime(0, 14.08);
        effector:SetKey(_TRACK_S, )]]
    
        -- Layer Layer_1
        local element = createCompositiondir_museya_cycle();
        element:SetName("Layer_1");
        compositiondirekor_museya:AddElement(element);
        element:SetHotSpot(320, 240);
        element:SetParentElement(compositiondirekor_museya);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(7.04, 14.08);
    
        effector:SetKey(_TRACK_X, 9.92, 320);
        effector:SetKey(_TRACK_Y, 9.92, 240);
        effector:SetKey(_TRACK_X, 10.02, 313.603376032058);
        effector:SetKey(_TRACK_Y, 10.02, 240.874475618575);
        effector:SetKey(_TRACK_X, 10.12, 297.89501040835);
        effector:SetKey(_TRACK_Y, 10.12, 243.021947033561);
        effector:SetKey(_TRACK_X, 10.22, 275.933227648343);
        effector:SetKey(_TRACK_Y, 10.22, 246.024317261938);
        effector:SetKey(_TRACK_X, 10.32, 249.376108954573);
        effector:SetKey(_TRACK_Y, 10.32, 249.654912221351);
        effector:SetKey(_TRACK_X, 10.42, 219.227562940092);
        effector:SetKey(_TRACK_Y, 10.42, 253.776484764216);
        effector:SetKey(_TRACK_X, 10.52, 186.144617855809);
        effector:SetKey(_TRACK_Y, 10.52, 258.299215977326);
        effector:SetKey(_TRACK_X, 10.62, 150.585352061563);
        effector:SetKey(_TRACK_Y, 10.62, 263.160483503534);
        effector:SetKey(_TRACK_X, 10.72, 112.878782300209);
        effector:SetKey(_TRACK_Y, 10.72, 268.315305291915);
        effector:SetKey(_TRACK_X, 10.82, 73.2372479349462);
        effector:SetKey(_TRACK_Y, 10.82, 273.734654457957);
        effector:SetKey(_TRACK_X, 10.92, 31.8068382080782);
        effector:SetKey(_TRACK_Y, 10.92, 279.398559268526);
        effector:SetKey(_TRACK_X, 11.02, -11.3484534265709);
        effector:SetKey(_TRACK_Y, 11.02, 285.298270065451);
        effector:SetKey(_TRACK_X, 11.12, -56.3270873476066);
        effector:SetKey(_TRACK_Y, 11.12, 291.447248230942);
        effector:SetKey(_TRACK_X, 11.16, -75);
        effector:SetKey(_TRACK_Y, 11.16, 294);
        effector:SetKey(_TRACK_SX, 9.92, 1);
        effector:SetKey(_TRACK_SY, 9.92, 1);
        effector:SetKey(_TRACK_SX, 10.02, 1.00991881725757);
        effector:SetKey(_TRACK_SY, 10.02, 1.00991880440073);
        effector:SetKey(_TRACK_SX, 10.12, 1.03427483935931);
        effector:SetKey(_TRACK_SY, 10.12, 1.03427484419375);
        effector:SetKey(_TRACK_SX, 10.22, 1.06831885433351);
        effector:SetKey(_TRACK_SY, 10.22, 1.06831885083853);
        effector:SetKey(_TRACK_SX, 10.32, 1.10949339725549);
        effector:SetKey(_TRACK_SY, 10.32, 1.10949338814053);
        effector:SetKey(_TRACK_SX, 10.42, 1.1562411107174);
        effector:SetKey(_TRACK_SY, 10.42, 1.15624111467504);
        effector:SetKey(_TRACK_SX, 10.52, 1.20753822398276);
        effector:SetKey(_TRACK_SY, 10.52, 1.20753822432792);
        effector:SetKey(_TRACK_SX, 10.62, 1.26267865608374);
        effector:SetKey(_TRACK_SY, 10.62, 1.26267864770732);
        effector:SetKey(_TRACK_SX, 10.72, 1.32116334220268);
        effector:SetKey(_TRACK_SY, 10.72, 1.32116334887891);
        effector:SetKey(_TRACK_SX, 10.82, 1.38264214020881);
        effector:SetKey(_TRACK_SY, 10.82, 1.38264213279037);
        effector:SetKey(_TRACK_SX, 10.92, 1.44688802843636);
        effector:SetKey(_TRACK_SY, 10.92, 1.44688802747106);
        effector:SetKey(_TRACK_SX, 11.02, 1.51380733687372);
        effector:SetKey(_TRACK_SY, 11.02, 1.51380733469195);
        effector:SetKey(_TRACK_SX, 11.12, 1.58355752837272);
        effector:SetKey(_TRACK_SY, 11.12, 1.58355753523084);
        effector:SetKey(_TRACK_SX, 11.16, 1.6125);
        effector:SetKey(_TRACK_SY, 11.16, 1.6125);
    
        effector:Play();
    
    
        -- Layer Layer_2
        local element = createCompositiondir_museya_cycle();
        element:SetName("Layer_2");
        compositiondirekor_museya:AddElement(element);
        element:SetHotSpot(320, 240);
        element:SetParentElement(compositiondirekor_museya);
        element:SetXY(320, 240);
    
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 7.04);
        effector:SetAnimationTime(10)
    
    
        effector:Play();
    
    
        -- Layer Layer_3
        local element = CreateCompositionElement("data/Texture/Movie/TV/2_-place_crime_1_bak_blur.jpg");
        element:SetName("Layer_3");
        compositiondirekor_museya:AddElement(element);
        element:SetHotSpot(200, 150);
        compositiondirekor_museya:RegisterParentInfo("Layer_3", "Layer_5");
        element:SetXY(512, 384);
    
        element:SetScaleX(2.56280193236715);
        element:SetScaleY(2.56280193236715);
        element:SetAngle(0);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 30.25);
    
        effector:SetKey(_TRACK_O, 10.28, 1);
        effector:SetKey(_TRACK_O, 11.08, 0);
    
        effector:Play();
    
    
        -- Layer Layer_4
        local element = CreateCompositionElement("data/Texture/Movie/TV/Mona_Medusa.jpg");
        element:SetName("Layer_4");
        compositiondirekor_museya:AddElement(element);
        element:SetHotSpot(245, 359.5);
        compositiondirekor_museya:RegisterParentInfo("Layer_4", "Layer_5");
        element:SetXY(496.000623863162, 343.066842348521);
    
        element:SetScaleX(0.17175572519084);
        element:SetScaleY(0.17175572519084);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        --effector:SetLifeTime(0, 30.25);
    
    
        effector:Play();
    
    
        -- Layer Layer_5
        local element = CreateCompositionElement("data/Texture/Movie/TV/2_-place_crime_1_bak.jpg");
        element:SetName("Layer_5");
        compositiondirekor_museya:AddElement(element);
        element:SetHotSpot(512, 384);
        element:SetParentElement(compositiondirekor_museya);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        --effector:SetLifeTime(0, 15);
    
        effector:SetKey(_TRACK_X, 9.92, 342.5);
        effector:SetKey(_TRACK_Y, 9.92, 244);
        effector:SetKey(_TRACK_X, 10.02, 342.712383431973);
        effector:SetKey(_TRACK_Y, 10.02, 244.831837234303);
        effector:SetKey(_TRACK_X, 10.12, 343.321469298005);
        effector:SetKey(_TRACK_Y, 10.12, 247.217418545795);
        effector:SetKey(_TRACK_X, 10.22, 344.276458118559);
        effector:SetKey(_TRACK_Y, 10.22, 250.957796942591);
        effector:SetKey(_TRACK_X, 10.32, 345.524809231428);
        effector:SetKey(_TRACK_Y, 10.32, 255.847169917026);
        effector:SetKey(_TRACK_X, 10.42, 347.021629418457);
        effector:SetKey(_TRACK_Y, 10.42, 261.709716965742);
        effector:SetKey(_TRACK_X, 10.52, 348.715907179443);
        effector:SetKey(_TRACK_Y, 10.52, 268.345636501596);
        effector:SetKey(_TRACK_X, 10.62, 350.559119235984);
        effector:SetKey(_TRACK_Y, 10.62, 275.564881874486);
        effector:SetKey(_TRACK_X, 10.72, 352.501128905021);
        effector:SetKey(_TRACK_Y, 10.72, 283.171088006245);
        effector:SetKey(_TRACK_X, 10.82, 354.492974601765);
        effector:SetKey(_TRACK_Y, 10.82, 290.972482047546);
        effector:SetKey(_TRACK_X, 10.92, 356.485265210182);
        effector:SetKey(_TRACK_Y, 10.92, 298.775621575684);
        effector:SetKey(_TRACK_X, 11.02, 358.428492014177);
        effector:SetKey(_TRACK_Y, 11.02, 306.386591421419);
        effector:SetKey(_TRACK_X, 11.12, 360.273167851893);
        effector:SetKey(_TRACK_Y, 11.12, 313.611573088563);
        effector:SetKey(_TRACK_X, 11.22, 361.967728490097);
        effector:SetKey(_TRACK_Y, 11.22, 320.248603861602);
        effector:SetKey(_TRACK_X, 11.32, 363.465969539818);
        effector:SetKey(_TRACK_Y, 11.32, 326.11671441147);
        effector:SetKey(_TRACK_X, 11.42, 364.718367296815);
        effector:SetKey(_TRACK_Y, 11.42, 331.021939083815);
        effector:SetKey(_TRACK_X, 11.52, 365.67336294259);
        effector:SetKey(_TRACK_Y, 11.52, 334.762335029795);
        effector:SetKey(_TRACK_X, 11.62, 366.28468024181);
        effector:SetKey(_TRACK_Y, 11.62, 337.156663261441);
        effector:SetKey(_TRACK_X, 11.72, 366.5);
        effector:SetKey(_TRACK_Y, 11.72, 338);
        effector:SetKey(_TRACK_SX, 9.92, 0.69);
        effector:SetKey(_TRACK_SY, 9.92, 0.69);
        effector:SetKey(_TRACK_SX, 10.02, 0.7072085017322);
        effector:SetKey(_TRACK_SY, 10.02, 0.70720849846488);
        effector:SetKey(_TRACK_SX, 10.12, 0.75618654837136);
        effector:SetKey(_TRACK_SY, 10.12, 0.75618654803108);
        effector:SetKey(_TRACK_SX, 10.22, 0.83296296318313);
        effector:SetKey(_TRACK_SY, 10.22, 0.83296295898989);
        effector:SetKey(_TRACK_SX, 10.32, 0.93356653032105);
        effector:SetKey(_TRACK_SY, 10.32, 0.93356653530319);
        effector:SetKey(_TRACK_SX, 10.42, 1.05402606621671);
        effector:SetKey(_TRACK_SY, 10.42, 1.05402607332111);
        effector:SetKey(_TRACK_SX, 10.52, 1.19037037696333);
        effector:SetKey(_TRACK_SY, 10.52, 1.19037037249878);
        effector:SetKey(_TRACK_SX, 10.62, 1.33862825558679);
        effector:SetKey(_TRACK_SY, 10.62, 1.33862825558923);
        effector:SetKey(_TRACK_SX, 10.72, 1.49482854054963);
        effector:SetKey(_TRACK_SY, 10.72, 1.494828523267);
        effector:SetKey(_TRACK_SX, 10.82, 1.65499999242503);
        effector:SetKey(_TRACK_SY, 10.82, 1.65500000324323);
        effector:SetKey(_TRACK_SX, 10.92, 1.81517147075595);
        effector:SetKey(_TRACK_SY, 10.92, 1.81517146004579);
        effector:SetKey(_TRACK_SX, 11.02, 1.97137174416385);
        effector:SetKey(_TRACK_SY, 11.02, 1.97137174733014);
        effector:SetKey(_TRACK_SX, 11.12, 2.11962962690987);
        effector:SetKey(_TRACK_SY, 11.12, 2.11962962509799);
        effector:SetKey(_TRACK_SX, 11.22, 2.25597392981622);
        effector:SetKey(_TRACK_SY, 11.22, 2.25597393614119);
        effector:SetKey(_TRACK_SX, 11.32, 2.37643346852217);
        effector:SetKey(_TRACK_SY, 11.32, 2.37643346091665);
        effector:SetKey(_TRACK_SX, 11.42, 2.47703704447278);
        effector:SetKey(_TRACK_SY, 11.42, 2.47703704185674);
        effector:SetKey(_TRACK_SX, 11.52, 2.55381343960535);
        effector:SetKey(_TRACK_SY, 11.52, 2.55381344687089);
        effector:SetKey(_TRACK_SX, 11.62, 2.60279149416133);
        effector:SetKey(_TRACK_SY, 11.62, 2.60279149868296);
        effector:SetKey(_TRACK_SX, 11.72, 2.62);
        effector:SetKey(_TRACK_SY, 11.72, 2.62);
    
        effector:Play();
    
    
        -- Layer Layer_6
        local element = CreateCompositionElement("data/Texture/Movie/TV/Komnata_2 .jpg");
        element:SetName("Layer_6");
        compositiondirekor_museya:AddElement(element);
        element:SetHotSpot(512, 384);
        element:SetParentElement(compositiondirekor_museya);
        element:SetXY(280.968246459961, 222.817459106445);
    
        element:SetScaleX(0.83);
        element:SetScaleY(0.83);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 7.04);
    
    
        effector:Play();
    
        compositiondirekor_museya:Play();
    
        return compositiondirekor_museya;
    end
    local result = createCompositiondirekor_museya()
	result:SetHotSpot(320, 240)
	return result
end


function AddAnimatedEyesLogic(screen, obj_name, lower_bound, upper_bound, mode, times)
	if not times then
		times = 1
	end
	screen:GetObject(obj_name):GetAnimation():SetMode(mode)	
	local comics_timer = screen:GetTimer()
	
	local SetToStart = function()
		screen:GetObject(obj_name):GetAnimation():SetFrame(0)
		screen:GetObject(obj_name):GetAnimation():Stop()
	end
	
	local Blink
    Blink = function()	    
	    local obj = screen:GetObject(obj_name)
		obj:GetAnimation():Play()
	    TimerDo(comics_timer,
                math.random(lower_bound, upper_bound),
                Blink)
		TimerDo(comics_timer,
				times * GetAnimationLength(obj:GetAnimation()),
				SetToStart)
	end
	SetToStart()
	Blink()
end

-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function LoadData(screen)
	local anim = CreateAnimation('data/Texture/Movie/bg.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bg',anim,512,384,80,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/sh_chay.png',0,0,253,250,20,12)
	anim:SetHotSpot(127,125)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('sh_chay',anim,707,522,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/Bubble.png',0,0,821,159,1,0)
	anim:SetHotSpot(0,0)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Bubble',anim,154,602,400,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/anim/vodorosli.png',0,0,294,272,16,10)
	anim:SetHotSpot(147,136)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('vodorosli',anim,812,490,90,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/anim/osminog.png',0,0,164,246,42,10)
	anim:SetHotSpot(82,123)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('osminog',anim,820,435,90,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/anim/kaystika.png',0,0,170,287,25,10)
	anim:SetHotSpot(85,144)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('kaystika',anim,820,451,95,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/anim/telik/NewsReader2.png',0,0,111,98,67,10)
	anim:SetHotSpot(56,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('NewsReader2',anim,564,400,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/TV/tv.dds',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('tv',anim,512,384,390,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/nkl.png',0,0,171,319,1,0)
	anim:SetHotSpot(85,159)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('nkl',anim,819,452,96,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/anim/telik/NewsReader1.png',0,0,109,96,36,10)
	anim:SetHotSpot(56,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('NewsReader1',anim,568,400,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/anim/telik/pomex.png',0,0,109,96,18,10)
	anim:SetHotSpot(55,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pomex',anim,568,400,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/sh_govorit.png',0,0,59,34,12,8)
	anim:SetHotSpot(30,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sh_govorit',anim,750,482,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/sin_talk.png',0,0,40,24,12,8)
	anim:SetHotSpot(20,12)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sin_talk',anim,506,503,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/zenka.png',0,0,25,33,11,8)
	anim:SetHotSpot(13,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('zenka',anim,411,489,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/baby_eye.png',0,0,31,19,3,8)
	anim:SetHotSpot(15,9)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('baby_eye',anim,500,464,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/she_eye.png',0,0,38,18,3,8)
	anim:SetHotSpot(19,9)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('she_eye',anim,403,435,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/he_eye.png',0,0,38,28,3,8)
	anim:SetHotSpot(19,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('he_eye',anim,751,437,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Movie/intro_new.png',0,0,533,213,1,0)
	anim:SetHotSpot(266,106)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('intro_new',anim,568,513,99,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
