local panel

function PanelOnSceneLoad(screen)
    LoadData(screen)

    panel = screen

    local back = screen:GetObject('background')

    local back_comics = screen:GetObject('background_comics')
    back_comics:AttachTo(back)
    back_comics:SetXY(back_comics:GetX() - back:GetX(), back_comics:GetY() - back:GetY())
    back_comics:SetZ(back_comics:GetZ() - back:GetZ())

    local cornice = screen:GetObject('cornice')
    cornice:AttachTo(back)
    cornice:SetXY(cornice:GetX() - back:GetX(), cornice:GetY() - back:GetY())
    cornice:SetZ(cornice:GetZ() - back:GetZ())

    local monolog_back = screen:GetObject('back_comics_monolog')
    monolog_back:AttachTo(back)
    monolog_back:SetXY(monolog_back:GetX() - back:GetX(), monolog_back:GetY() - back:GetY())
    monolog_back:SetZ(monolog_back:GetZ() - back:GetZ())

    local shadow = screen:GetObject('Shadow')
    shadow:AttachTo(back)
    shadow:SetXY(shadow:GetX() - back:GetX(), shadow:GetY() - back:GetY())
    shadow:SetZ(shadow:GetZ() - back:GetZ())
	screen:IgnoreOnTestPoint('Shadow')

    screen:GetObject('mechanism'):GetAnimation():Stop()
	screen:GetObject('timer_activation_anim'):GetAnimation():SetMode(HGEANIM_NOLOOP)
	screen:GetObject('timer_activation_anim'):GetAnimation():Stop()

    panel.objects_to_scale = {}
    --panel.objects_to_scale['button_r'] = 1.05
    --panel.objects_to_scale['button_l'] = 1.05
    --panel.objects_to_scale['button_down_r'] = 1.1
    --panel.objects_to_scale['button_down_l'] = 1.1

    screen:SetLayer(5);

    local set_mouse_dependent_states = function(object, mouse_not_over, mouse_over, mouse_pressed)
        if not panel.mouse_dependent_states then
            panel.mouse_dependent_states = {}
        end
        panel.mouse_dependent_states[object] = {}
        panel.mouse_dependent_states[object].mouse_not_over = mouse_not_over
        panel.mouse_dependent_states[object].mouse_over = mouse_over
        panel.mouse_dependent_states[object].mouse_pressed = mouse_pressed
        
        panel:IgnoreOnTestPoint(mouse_not_over)
        panel:IgnoreOnTestPoint(mouse_over)
        panel:IgnoreOnTestPoint(mouse_pressed)

        panel:GetObject(mouse_not_over):AttachTo(panel:GetObject(object))
        panel:GetObject(mouse_over):AttachTo(panel:GetObject(object))
        panel:GetObject(mouse_pressed):AttachTo(panel:GetObject(object))

        panel:GetObject(mouse_over):SetVisible(false)
        panel:GetObject(mouse_pressed):SetVisible(false)
    end

    set_mouse_dependent_states('button_l_hint', 'hint', 'hint_mouse_over', 'hint_mouse_pressed')
    set_mouse_dependent_states('button_l_inventory', 'inventory', 'inventory_mouse_over', 'inventory_mouse_pressed')
    set_mouse_dependent_states('button_l_skip', 'skip', 'skip_mouse_over', 'skip_mouse_pressed')
    set_mouse_dependent_states('button_r', 'menu', 'menu_mouse_over', 'menu_mouse_pressed')

    panel:GetObject('background_comics'):SetOpacity(0.)
    panel:GetObject('background_comics'):SetVisible(false)

    panel:GetObject('back_comics_monolog'):SetOpacity(0.6)

    panel:IgnoreOnTestPoint("cornice")

    panel:GetObject('sand_glass'):SetOpacity(0.)
    panel:GetObject('hes_down'):SetOpacity(0.)
    panel:GetObject('pes_up'):SetOpacity(0.)

    PanelSetSkipButtonVisible(false)
end

function PanelOnSceneStart()
    if game_state.level_mode == 'hidden_object'
    then
        local back = panel:GetObject('background')

        local curtain = panel:GetObject('drop_curtain')
        curtain:AttachTo(back)
        curtain:SetXY(curtain:GetX() - back:GetX(), curtain:GetY() - back:GetY())
        curtain:SetZ(curtain:GetZ() - back:GetZ())
        local curtain_anim = curtain:GetAnimation()
        curtain_anim:Stop()
        curtain_anim:SetMode(HGEANIM_NOLOOP)

        PlaySound("Curtains_up");
        local scene_path = panel:GetLevelScreen():GetName()
        if HasGameState('SceneVisited', scene_path) then
            curtain_anim:SetFrame(curtain_anim:GetFrames() - 1)
            curtain_anim:Stop()
        else
            TimerDoString("play_field:GetLevelScreen():GetPanel():GetObject('drop_curtain'):GetAnimation():Play();" .. 
                          "PlaySound(\"Curtains_open\")",
                          1.,
                          panel:GetTimer())
            --curtain_anim:Play()
        end

		-- temporary disabled, enabled only in 13ho
		panel:GetObject('Shadow'):Hide()
    else
		panel:GetObject('Shadow'):Hide()
        --curtain:Set
    end
end

function PanelSetSkipButtonVisible(is_visible)
    if is_visible then
        game_state.panel_button_name_to_restore = 'button_l_hint'
        if panel:GetObject('button_l_inventory'):IsVisible() then
            game_state.panel_button_name_to_restore = 'button_l_inventory'
        end
        panel:GetObject(game_state.panel_button_name_to_restore):Hide()
        panel:GetObject('button_l_skip'):Show()
    else
        if game_state.panel_button_name_to_restore then
            panel:GetObject(game_state.panel_button_name_to_restore):Show()
        end
        panel:GetObject('button_l_skip'):Hide()
    end
end

function PanelOnSceneFree(screen)
    FreeData(screen)
end

function PanelOnObjectMouseEnter(object)
    if (object:GetName() == 'button_l_hint' or object:GetName() == 'button_l_skip') and
       (not panel:IsHintEnabled() or object:IsPaused())
    then
        return
    end

    if panel.objects_to_scale[object:GetName()] then    
        object:SetScale(panel.objects_to_scale[object:GetName()])
    end

    if panel.mouse_dependent_states[object:GetName()] then
        local info = panel.mouse_dependent_states[object:GetName()]
        panel:GetObject(info.mouse_not_over):SetVisible(false)
        panel:GetObject(info.mouse_over):SetVisible(true)
        panel:GetObject(info.mouse_pressed):SetVisible(false)
    end

    if object:GetName() == 'right' or
       object:GetName() == 'mechanism' or
       object:GetName() == 'button_r'
    then
        panel:GetObject('mechanism'):GetAnimation():Play()
    end
end

function PanelOnObjectMouseLeave(object)
	if object:IsPaused() then
		return
	end

    if panel.objects_to_scale[object:GetName()] then    
        object:SetScale(1.)
    end

    if panel.mouse_dependent_states[object:GetName()] then
        local info = panel.mouse_dependent_states[object:GetName()]
        panel:GetObject(info.mouse_not_over):SetVisible(true)
        panel:GetObject(info.mouse_over):SetVisible(false)
        panel:GetObject(info.mouse_pressed):SetVisible(false)
    end

    if object:GetName() == 'right' or
       object:GetName() == 'mechanism' or
       object:GetName() == 'button_r'
    then
        panel:GetObject('mechanism'):GetAnimation():Stop()
    end
end

function OnInventoryButtonPress()
    assert(panel:GetMode() ~= PM_HIDDENOBJECT)

    if game_state.is_inventory_opened ~= nil then
        if game_state.is_inventory_opened then
            if play_field:GetTool() ~= '' then
                DropTool(0.)
            end
            HideInventory()
            TimerDoString('game_state.is_inventory_opened = false', 0.2, panel:GetTimer())
        else
            ShowInventory()
            --TimerDoString('game_state.is_inventory_opened = true', 6.66666666666667, panel:GetTimer())
            TimerDoString('game_state.is_inventory_opened = true', 0.2, panel:GetTimer())
            --GTimerDoString('game_state.is_inventory_opened = true', 0.2)
        end
        game_state.is_inventory_opened = nil
        --game_state.is_inventory_opened = not game_state.is_inventory_opened
    end
end

function PanelOnObjectMouseDown(object)
	if object:IsPaused() then
		return
	end

    if panel.mouse_dependent_states[object:GetName()] and
       not ((object:GetName() == 'button_l_hint' or object:GetName() == 'button_l_skip') and not panel:IsHintEnabled())
    then
        local info = panel.mouse_dependent_states[object:GetName()]
        panel:GetObject(info.mouse_not_over):SetVisible(false)
        panel:GetObject(info.mouse_over):SetVisible(false)
        panel:GetObject(info.mouse_pressed):SetVisible(true)
    end

    local obj_name = object:GetName()
    if obj_name == 'button_r' then
        PlaySound('Menu_button_click');
        StartIngameMenu();
    end
    if obj_name == 'button_l_inventory' then
        OnInventoryButtonPress()
        PlaySound('Menu_button_click');
    end
    if obj_name == 'button_l_hint' then
        if panel:GetDelayTimer() <= 0. then
            panel:ButtonPress('Hint')
            PlaySound('Menu_button_click');
        end
    end
    if obj_name == 'button_l_skip' then
        if panel:GetDelayTimer() <= 0. then
            panel:ButtonPress('Skip')
			panel:GetObject("button_l_skip"):Stop()
			panel:GetObject("button_l_skip"):GetAnimation():SetColor("0xFF888888")
            SkipMiniGame()
            PlaySound('Menu_button_click');
        end
    end
    if obj_name == 'button_down_r' then
        panel:ButtonPress('Close')
    end

    if game_state.level_mode == 'hidden_object' and
       IsAboveReturnFromZoomZone() and
       play_field:GetLevelScreen():HasTaskObjects() and
       not play_field.mouseDownBlocked
    then
        SetCursor('CursorDefault')
        panel:ButtonPress('Close')
    end

    UpdateComicsRequest()
end

function PanelOnObjectMouseUp(object)
	if object:IsPaused() then
		return
	end

    if panel.mouse_dependent_states[object:GetName()]  and
       not ((object:GetName() == 'button_l_hint' or object:GetName() == 'button_l_skip') and not panel:IsHintEnabled())
    then
        local info = panel.mouse_dependent_states[object:GetName()]
        panel:GetObject(info.mouse_not_over):SetVisible(false)
        panel:GetObject(info.mouse_over):SetVisible(true)
        panel:GetObject(info.mouse_pressed):SetVisible(false)
    end
end

function PanelOnButtonPress(title)
end

function PanelAnimateSandGlass()
    local movieDuration = 12;
    local speed = 12. / 30.;

    local screen = panel
    local zOffset = 330.

    -- Layer sand_glass

    --anim = CreateAnimationByPath("data/Texture/GUI/Panel/ch.png");
    object = screen:GetObject("sand_glass")--, anim, 0, 0, 0, 0, 1, 1);
    local anim = object:GetAnimation()
    anim:SetHotSpot(16, 25);
    object:SetXY(17, 742);
    object:SetZ(zOffset + 2);
    object:SetScaleX(1);
    object:SetScaleY(1);
    object:SetAngle(0);
    object:SetOpacity(1);

    effector = CreateAnimationEffector();
    effector:SetLifeTime(0 / speed, 12 / speed);
    effector:AttachTo(object);

    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.2, 1);
    effector:SetKey(_TRACK_O, (movieDuration - 0.2) / speed, 1);
    effector:SetKey(_TRACK_O, movieDuration / speed, 0);


    effector:Play();


    -- Layer sand_top
    --anim = CreateAnimationByPath("data/Texture/GUI/Panel/pes_up.png");
    object = screen:GetObject("pes_up")--, anim, 0, 0, 0, 0, 1, 1);
    local anim = object:GetAnimation()
    anim:SetHotSpot(5.5, 9);
    object:SetXY(14.5, 739.5);
    object:SetZ(zOffset + 1);
    object:SetAngle(0);
    object:SetOpacity(1);

    effector = CreateAnimationEffector();
    effector:SetLifeTime(0 / speed, 12 / speed);
    effector:AttachTo(object);

    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.2, 1);
    effector:SetKey(_TRACK_SX, 0 / speed, 1);
    effector:SetKey(_TRACK_SY, 0 / speed, 1);
    effector:SetKey(_TRACK_SX, 11.9583333333333 / speed, 0.2);
    effector:SetKey(_TRACK_SY, 11.9583333333333 / speed, 0.2);
    effector:SetKey(_TRACK_O, (movieDuration - 0.2) / speed, 1);
    effector:SetKey(_TRACK_O, movieDuration / speed, 0);

    effector:Play();


    -- Layer sand_bottom
    --anim = CreateAnimationByPath("data/Texture/GUI/Panel/hes_down.png");
    object = screen:GetObject("hes_down")--, anim, 0, 0, 0, 0, 1, 1);
    local anim = object:GetAnimation()
    anim:SetHotSpot(6.5, 8);
    object:SetXY(14, 756.25);
    object:SetZ(zOffset + 0);
    object:SetAngle(0);
    object:SetOpacity(1);

    effector = CreateAnimationEffector();
    effector:SetLifeTime(0 / speed, 12 / speed);
    effector:AttachTo(object);

    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.2, 1);
    effector:SetKey(_TRACK_SX, 0 / speed, 0.23);
    effector:SetKey(_TRACK_SY, 0 / speed, 0.23);
    effector:SetKey(_TRACK_SX, 11.9583333333333 / speed, 1);
    effector:SetKey(_TRACK_SY, 11.9583333333333 / speed, 1);
    effector:SetKey(_TRACK_O, (movieDuration - 0.2) / speed, 1);
    effector:SetKey(_TRACK_O, movieDuration / speed, 0);

    effector:Play();
end

function PanelOnModeChanged(screen)
	--UpdateComicsRequest()
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/GUI/Panel/Back.png',0,0,730,96,1,0)
	anim:SetHotSpot(365,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('background',anim,490,797,200,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/drop_curtain.png',0,0,788,98,12,12)
	anim:SetHotSpot(413,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('drop_curtain',anim,500,796,205,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/cornice.png',0,0,721,80,1,0)
	anim:SetHotSpot(360,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cornice',anim,490,748,210,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/left.png',0,0,152,150,1,0)
	anim:SetHotSpot(76,75)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('left',anim,76,693,315,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/right.png',0,0,206,215,1,0)
	anim:SetHotSpot(103,107)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('right',anim,921,660,215,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/mechanism.png',0,0,62,40,6,12)
	anim:SetHotSpot(31,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('mechanism',anim,933,637,216,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/button_down_l.png',0,0,44,40,1,0)
	anim:SetHotSpot(22,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('button_down_l',anim,22,748,320,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/button_l.png',0,0,104,74,1,0)
	anim:SetHotSpot(52,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('button_l_hint',anim,61,719,317,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/button_l.png',0,0,104,74,1,0)
	anim:SetHotSpot(52,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('button_l_inventory',anim,61,718,317,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/button_l.png',0,0,104,74,1,0)
	anim:SetHotSpot(52,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('button_l_skip',anim,61,718,318,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/button_r.png',0,0,206,215,1,0)
	anim:SetHotSpot(103,107)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('button_r',anim,921,659,217,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/button_down_r.png',0,0,71,40,1,0)
	anim:SetHotSpot(35,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('button_down_r',anim,988,749,220,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Hint/hint.png',0,0,54,30,1,0)
	anim:SetHotSpot(27,15)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hint',anim,3,1,320,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Hint/hint_mouse_over.png',0,0,58,34,1,0)
	anim:SetHotSpot(29,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hint_mouse_over',anim,1,-2,320,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Hint/hint_mouse_pressed.png',0,0,46,20,1,0)
	anim:SetHotSpot(23,10)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hint_mouse_pressed',anim,1,-2,320,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Inventory/Tools.png',0,0,65,34,1,0)
	anim:SetHotSpot(32,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('inventory',anim,0,1,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Inventory/Tools_mouse_over.png',0,0,65,34,1,0)
	anim:SetHotSpot(32,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('inventory_mouse_over',anim,0,1,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Inventory/Tools_mouse_pressed.png',0,0,65,34,1,0)
	anim:SetHotSpot(32,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('inventory_mouse_pressed',anim,0,1,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Skip/skip.png',0,0,57,43,1,0)
	anim:SetHotSpot(28,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('skip',anim,3,1,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Skip/skip_mouse_over.png',0,0,57,43,1,0)
	anim:SetHotSpot(28,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('skip_mouse_over',anim,3,1,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Skip/skip_mouse_pressed.png',0,0,57,43,1,0)
	anim:SetHotSpot(28,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('skip_mouse_pressed',anim,3,2,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Menu/menu.png',0,0,62,32,1,0)
	anim:SetHotSpot(31,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('menu',anim,0,35,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Menu/menu_mouse_over.png',0,0,65,36,1,0)
	anim:SetHotSpot(32,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('menu_mouse_over',anim,-2,32,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Menu/menu_mouse_pressed.png',0,0,54,23,1,0)
	anim:SetHotSpot(27,11)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('menu_mouse_pressed',anim,-2,32,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/dialog.png',0,0,1024,210,1,0)
	anim:SetHotSpot(512,105)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('background_comics',anim,512,665,200,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/BackComics.png',0,0,827,128,1,0)
	anim:SetHotSpot(413,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('back_comics_monolog',anim,512,805,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/ch.png',0,0,32,50,1,0)
	anim:SetHotSpot(16,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sand_glass',anim,23,749,330,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/hes_down.png',0,0,13,8,1,0)
	anim:SetHotSpot(6,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hes_down',anim,512,384,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/pes_up.png',0,0,11,10,1,0)
	anim:SetHotSpot(5,5)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pes_up',anim,512,384,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Timer/timer_back.png',0,0,94,76,1,0)
	anim:SetHotSpot(47,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('timer_back',anim,62,720,440,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Timer/timer_arrow.png',0,0,16,42,1,0)
	anim:SetHotSpot(7,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('timer_arrow',anim,62,719,444,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Timer/timer_top.png',0,0,94,76,1,0)
	anim:SetHotSpot(47,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('timer_top',anim,62,720,443,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/Shadow.PNG',0,0,1053,281,1,0)
	anim:SetHotSpot(526,140)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Shadow',anim,497,690,199,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/TimerActivationAnim.png',0,0,128,128,42,24)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('timer_activation_anim',anim,62,703,750,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
