local iArrowObj=-1;
skip = false;
function SkipActions()
    SkipMini()
    flags.mini_code = true;    
    Block_Show_Cur(true);
    playeffect("miniok")
    StartTimer(9983,2);
end;

function Buttons_T(sender,obj_id)
   ButtonTreatment(obj_id,10001,10002,10003,CloseBtnX,CloseBtnY,CloseWidth,CloseHeight,sender,"holl",true)
   ButtonTreatment(obj_id,10021,10022,10023,HelpBtnX,HelpBtnY,HelpWidth,HelpHeight,sender,"holl",true,218,200,200)
   if skip then
    ButtonTreatment(obj_id,10011,10012,10013,SkipBtnX,SkipBtnY,111,31,sender,"holl",true)
   end;
end;

function mini_create ()
    show_help_wnd=true;
    init_mini(true);
    create_mini(2,10,4,2147000000,0,"7124",1028,456789123,29,71,0,0);
    WaitRender();
    StartTimer(88821,0.5)
end;
function gameinput (sender,id,attachedID)
   CursorTreatment(id,sender,attachedID);
   Buttons_T(sender,id)
   
   if sender==154 then
    if flags.ShowTutorial then
    nexttutorial=true
    end;
  end;  
  if sender == 30 then
      DeleteResource("pympa_help");
      DeleteResource("help_1");
      DeleteResource("vetki_help");
      DeleteResource("skip2");
      DeleteResource("skip_not_act");
      DeleteResource("act_btn"    );
      DeleteResource("not_act_btn");
      DeleteResource("border"     );     
      DeleteResource("pympa"     );
      DeleteResource("digit"      );
      DeleteResource("plashki"     );
      DeleteResource("door"       );
      DeleteResource("minicomplete");
      DeleteResource("9002");  
    setcurentleaf("holl",1,0); 
    flags.help_holl_code = true;       
    DarkScreen(false);

    if flags.mini_code then    
      StopEmiter("laborator");
      
      speciale_action(2,27);
      speciale_action(2,26);
      Set_Anim_Cur(26,17);
    end;
  WaitRender()
  return; end;
  if sender==37 then
    skip = true;
  return;end;
  if sender==26 then
    if id==9002 then
      StartTimer(88821,0.2)
    return;end;
  if id==910000 then
    if  flags.ShowTutorial and nexttutorial and flags.mes_tutorial==6 then
       CreateTutorial("3060",308,234,4)
       nexttutorial=false
       flags.mes_tutorial=7;
    return;end;      
  return;end;
  return;end;
  if sender == 36 then   
    if id == 88821 then
        Block_Show_Cur(false)
    if flags.cod then
      CreatePlashechka(910000,"218")
    end;
    return; end;  



    if id == 9983 then
      Block_Show_Cur(false);
       finish_mini_game(true);
      clear_satelite_leaf("holl");    
    return; end;
  return; end;
  
  if sender == 10 then

    flags.mini_code = true;    
    Block_Show_Cur(true);
    playeffect("miniok")
    StartTimer(9983,2);
  return; end;
  
  if sender==100 then
    Block_Show_Cur(false);
    
    if check then
        if flags.mini_code then
          speciale_action(2,1002,true);
          speciale_action(2,1000,true);
          
        return;end;
        speciale_action(2,1002,true);
        speciale_action(2,1001,true);    
    return;end;
    if not check and flags.minifirst then
       flags.minifirst=false;
    return;end;
    
  return;end;
  
  if sender == 1 then  
       if attachedID ~= -1 then
        RemObjFromMouse()
      end; 

    
    if not flags.cod then
    CreatePlashechka(900000,"1008")
    return;end;
    
    if id == 1007 then     
      playeffect("btn")    
      check_mini_game_zamok(1028,0,2);
      flags.press=true;      
      iArrowObj = id;
      speciale_action(2,id);
      speciale_action(2,id-1);
    return; end;
    if id == 1009 then
      playeffect("btn")    
      check_mini_game_zamok(1029,1,2);
      flags.press=true;      
      iArrowObj = id;
      speciale_action(2,id);
      speciale_action(2,id-1);
    return; end;
    if id == 1011 then
      playeffect("btn")    
      check_mini_game_zamok(1030,2,2);
      flags.press = true;      
      iArrowObj = id;
      speciale_action(2,id);
      speciale_action(2,id-1);
    return; end;
    if id == 1013 then
      playeffect("btn")    
      check_mini_game_zamok(1031,3,2);
      flags.press=true;      
      iArrowObj = id;
      speciale_action(2,id);
      speciale_action(2,id-1);
    return; end;
    if id == 1015 then
      playeffect("btn")    
      check_mini_game_zamok(1028,0,1);
      flags.press=true;      
      iArrowObj = id;
      speciale_action(2,id);
      speciale_action(2,id-1);
    return; end;
    if id == 1017 then
      playeffect("btn")    
      check_mini_game_zamok(1029,1,1);
      flags.press=true;      
      iArrowObj = id;
      speciale_action(2,id);
      speciale_action(2,id-1);
    return; end;
    if id == 1019 then
      playeffect("btn")    
      check_mini_game_zamok(1030,2,1);
      flags.press=true;      
      iArrowObj = id;
      speciale_action(2,id);
      speciale_action(2,id-1);
    return; end;
    if id == 1021 then
      playeffect("btn")    
      check_mini_game_zamok(1031,3,1);
      flags.press=true;      
      iArrowObj = id;
      speciale_action(2,id);
      speciale_action(2,id-1);
    return; end;
    if id == 1002 then
      WaitRender();
      check=true;
      playeffect("dvr")
      check_mini_game_zamok(1031,3,4);
    return; end;
  return; end; 
  
  if sender == 6 then

    if flags.press then
      speciale_action(2,iArrowObj);
      speciale_action(2,iArrowObj-1);
      flags.press=false;
    return; end;
  return; end;
  
  if sender == 16 then
    if id == 1001 then
      speciale_action(2,1002,true);
      speciale_action(2,1001,true);
    return; end;
  return; end;

end;

function mini_delete ()

end;
function SheetSwitched(nCount)
end;