function mini_create ()
    show_help_wnd=true;
    init_mini(1);
  create_mini(2,8,8,2147000000,0,"01234567",1011,456789123,66,66,0,0);
  StartTimer(88821,0.5)
end;

function SkipActions()
    finish_mini_game(true);
end;

function Buttons_T(sender,id)
   ButtonTreatment(id,10001,10002,10003,CloseBtnX,CloseBtnY,CloseWidth,CloseHeight,sender,"turma",true)
   ButtonTreatment(id,10021,10022,10023,HelpBtnX,HelpBtnY,HelpWidth,HelpHeight,sender,"turma",true,407,200,200)
   if skip then
    ButtonTreatment(id,10011,10012,10013,SkipBtnX,SkipBtnY,508,32,sender,"turma",true)
   end;  
end;

function gameinput (sender,id,attachedID)
CursorTreatment(id,sender,attachedID);
Buttons_T(sender,id)

    if sender == 30 then 
        DeleteResource("zamok_kamery_05");
        DeleteResource("zamok_kamery1");
        DeleteResource("zamok_kamery2");
        DeleteResource("symbols"); 
        DeleteResource("zamok_kamery_22");     
      setcurentleaf("turma",14,0);     
      Block_Show_Cur(false);
      if flags.zamok_kamera then
        StopEmiter("zamok_kamera");
        CreatePlashechka(900000,"3047")
        playeffect("gate")
        speciale_action(2,12);
        speciale_action(2,11);
        Set_Anim_Cur(11,18);
        speciale_action(2,3);
        speciale_action(2,4);
      end;
    return; end;
    
    if sender==10 then
    HideSkip()
    HideHelp()
    set_visible_object(2005,false)
      Block_Show_Cur(true);
      playeffect("miniok")
      speciale_action(2,1021,true);
      speciale_action(2,1020,true);
      StartTimer(88850,1);
    return; end;

    if sender==37 then
      skip = true;
    return;end;

    if sender == 100 then
      StartTimer(88811,0.3);
    return; end;
    
    if sender == 36 then      
      if id == 88811 then
        Block_Show_Cur(false);
        CreatePlashechka(900000,"407")
      return; end;
      if id == 88850 then    
        Block_Show_Cur(false);
        flags.zamok_kamera = true;
        clear_satelite_leaf("turma");
        finish_mini_game(true);
      return; end;
    return; end;
    
    if sender == 1 then
  
      if id == 1008 then
      if attachedID ~= -1 then
        RemObjFromMouse()
      end;      
        CreatePlashechka(900000,"408")
      return; end;
      if id == 1010 then
        if obj.gruzik ~= nil and attachedID == obj.gruzik.id then
          RemObjFromMouse()
          UnStoreObj(attachedID);
          flags.is_gruzik = true;
          playeffect("gruzik")
          neighbors.kamera.lock=false;      
          LoadLocation("kamera");              
          Set_Anim_Cur(1010,3)
          if flags.stenka then 
            AddSkipBtn(488+20,32);  
          end;
          speciale_action(2,1009,true);
        return; end;
      if attachedID~=-1 and ((obj.gruzik~=nil and attachedID ~= obj.gruzik.id) or (obj.gruzik==nil ))  then
        RemObjFromMouse()
        CreatePlashechka(900000,"1000")
      return;end;        
        CreatePlashechka(900000,"409")      
      return; end;

      if attachedID ~= -1 then
        RemObjFromMouse()
      end;
      
    if not flags.stenka then
        CreatePlashechka(900000,"1009")
    return;end;
      if id == 1011 then
        playeffect("btn")
        check_mini_game_zamok(1011,0,1+4);
      return; end;
      if id == 1012 then
        playeffect("btn")
        check_mini_game_zamok(1012,1,1+4);
      return; end;
      if id == 1013 then 
        playeffect("btn")
        check_mini_game_zamok(1013,2,1+4);
      return; end;
      if id == 1014 then
        playeffect("btn")
        check_mini_game_zamok(1014,3,1+4);
      return; end;
      if id == 1015 then
        playeffect("btn")
        check_mini_game_zamok(1015,4,1+4);
      return; end;
      if id == 1016 then
        playeffect("btn")
        check_mini_game_zamok(1016,5,1+4);
      return; end;
      if id == 1017 then
        playeffect("btn")
        check_mini_game_zamok(1017,6,1+4);
      return; end;
      if id == 1018 then
        playeffect("btn")
        check_mini_game_zamok(1018,7,1+4);
      return; end;
    return; end;
    
    if sender == 16 then
      if id == 1009 then
        speciale_action(2,10011)
        speciale_action(2,1007,true);
        speciale_action(2,1010,true);
        speciale_action(2,1009,true);
      return; end;
      if id == 1007 then
        speciale_action(2,1008,true);
      return; end;
    return; end;


end;
