function OnSceneLoad(screen)
    game_state = {}    
    LoadData(screen)
    local pf = play_field
    local level = pf:GetLevelScreen()
    game_state.custom_cursors = {}
    game_state.locked_objects = {}
    --level:AddTaskSafe(CreateTask('', '', ''))
    --zone = CreateZoomZone('')
    game_state.locker = ReferenceCounter()
    game_state.active_zone = nil
    game_state.inventory_zones = {}
    game_state.active_objects = {}
	
	
	play_field:IgnoreOnTestPoint('ray1')
	play_field:IgnoreOnTestPoint('ray2')
	
	local af = CreateAnimationEffector()
	af:AttachTo(play_field:GetObject('ray1'))
	af:SetMode(_ANIM_LOOP + _ANIM_PINGPONG)
	af:SetKey(_TRACK_O, 0, 0)
	af:SetKey(_TRACK_O, 2, 1)
	af:Play()
	
	local af = CreateAnimationEffector()
	af:AttachTo(play_field:GetObject('ray2'))
	af:SetMode(_ANIM_LOOP + _ANIM_PINGPONG)
	af:SetKey(_TRACK_O, 0, 1)
	af:SetKey(_TRACK_O, 2, 0)
	af:Play()
	
	play_field:GetObject('hanger_full'):SetOpacity(0)	
	game_state.meta_object = 'cigar12'
end

function OnNotebookOpened()
end

function OnScreenShown()
end

function OnSceneFree(screen)
    FreeData(screen)
end

function OnUpdate(dt)
end

function OnExit()
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

    return is_wrong_click;    
end

function OnObjectMouseUp(object)
end

function OnObjectWillBeFound(object)

end

function OnObjectWasFound(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 CanBeHinted(obj)
    if locked_object[obj] ~= true then
        return true
    else
        return false
    end
end

function OnLostFocus()
end

function OnGainFocus()
end

function OnMinigameCompleted()
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/Scenes/12_security_5/Layers/bg.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bg',anim,512,384,88,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Layers/veshalka_bez_odejdy.png',0,0,236,541,1,0)
	anim:SetHotSpot(118,270)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hanger',anim,855,498,109,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Layers/veshalka_s_odejdoy.png',0,0,241,744,1,0)
	anim:SetHotSpot(120,650)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hanger_full',anim,853,853,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/jacket2.png',0,0,106,183,1,0)
	anim:SetHotSpot(53,91)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('jacket2',anim,289,289,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Zoom/zoom_bg.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('zoom_bg',anim,512,384,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Zoom/pill.png',0,0,29,29,1,0)
	anim:SetHotSpot(14,14)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pill',anim,493,343,115,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Zoom/caffee_over.png',0,0,74,57,1,0)
	anim:SetHotSpot(37,28)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('caffee_over',anim,506,349,116,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Zoom/spoon.png',0,0,253,171,1,0)
	anim:SetHotSpot(126,85)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('spoon',anim,372,479,115,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('cup_zone',anim,872,589,100,0,8,12)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Animations/lights/ray1.png',0,0,441,326,1,0)
	anim:SetHotSpot(220,163)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('ray1',anim,340,213,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Animations/lights/ray2.png',0,0,441,326,1,0)
	anim:SetHotSpot(220,163)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('ray2',anim,337,228,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/Sheriff.dds',0,0,530,636,1,0)
	anim:SetHotSpot(266,256)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Sheriff',anim,505,390,400,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/eyes.png',0,0,79,33,1,0)
	anim:SetHotSpot(39,16)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('eyes',anim,499,212,500,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pixel1',anim,512,384,401,0,128,96)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pixel2',anim,512,384,401,0,128,96)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pixel3',anim,512,384,401,0,128,96)
	local anim = CreateAnimation('data/Texture/Comics/Security_Guard.dds',0,0,632,696,1,0)
	anim:SetHotSpot(316,348)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Security_Guard',anim,684,423,400,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/hat.png',0,0,62,60,1,0)
	anim:SetHotSpot(31,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hat1',anim,838,52,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/hat2.png',0,0,45,27,1,0)
	anim:SetHotSpot(22,13)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hat2',anim,788,219,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/picture.png',0,0,51,41,1,0)
	anim:SetHotSpot(25,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('picture',anim,439,205,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/pincers.png',0,0,24,60,1,0)
	anim:SetHotSpot(12,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pincers',anim,393,196,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/arrow.png',0,0,27,153,1,0)
	anim:SetHotSpot(13,76)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('arrow',anim,740,300,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/bell.png',0,0,24,37,1,0)
	anim:SetHotSpot(12,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bell',anim,464,267,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/boots.png',0,0,68,99,1,0)
	anim:SetHotSpot(34,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('boots',anim,996,684,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Layers/sprait_1.png',0,0,133,158,1,0)
	anim:SetHotSpot(66,79)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprait_1',anim,279,336,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Layers/sprait_spinki_stula.png',0,0,98,69,1,0)
	anim:SetHotSpot(49,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprait_spinki_stula',anim,323,633,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Layers/sprait_stula.png',0,0,38,32,1,0)
	anim:SetHotSpot(19,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprait_stula',anim,743,371,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/dagger.png',0,0,34,109,1,0)
	anim:SetHotSpot(17,54)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('dagger',anim,381,575,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/ladle.png',0,0,32,72,1,0)
	anim:SetHotSpot(16,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ladle',anim,887,162,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/rolling_pin.png',0,0,103,59,1,0)
	anim:SetHotSpot(51,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('rolling_pin',anim,262,439,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Layers/sprait_bochki.png',0,0,22,77,1,0)
	anim:SetHotSpot(11,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprait_bochki',anim,970,678,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/4_directors_museum_office_2/Items/dart2.png',0,0,59,66,1,0)
	anim:SetHotSpot(29,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('dart',anim,512,122,100,0,0.8,0.8)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/pin.png',0,0,63,15,1,0)
	anim:SetHotSpot(31,7)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pin',anim,594,670,100,0,0.8,0.8)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/mousetrap.png',0,0,62,32,1,0)
	anim:SetHotSpot(31,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('mousetrap',anim,711,682,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/skittle.png',0,0,23,49,1,0)
	anim:SetHotSpot(11,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('skittle',anim,798,178,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/chain.png',0,0,26,112,1,0)
	anim:SetHotSpot(13,56)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('chain',anim,575,63,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/crown.png',0,0,30,29,1,0)
	anim:SetHotSpot(15,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('crown',anim,670,204,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/flower.png',0,0,21,19,1,0)
	anim:SetHotSpot(10,9)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('flower',anim,485,274,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/number_25.png',0,0,27,22,1,0)
	anim:SetHotSpot(13,11)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('number_25',anim,576,362,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/sun.png',0,0,65,47,1,0)
	anim:SetHotSpot(32,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sun',anim,599,735,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/Items/W.png',0,0,40,25,1,0)
	anim:SetHotSpot(20,12)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('W',anim,695,398,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_security_5/cigar12.png',0,0,69,112,1,0)
	anim:SetHotSpot(34,56)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cigar12',anim,628,641,100,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
