function mini_create ()
  init_mini(1);
  create_mini(2,3,3,545123565,0,"",19,27,56,96,71,115);
  -- create_mini(8128);
end;
function gameinput (sender,id,attachedID)
-- WriteToConsole(sender)
  if sender==30 then
  flags.comend=true;
  BlockCursor(false);
  setcurentleaf("kabinet",26,0);
    flags.nohints=false;
    if flags.minicomplete then  
      StopEmiter("Svet"); 
      playeffect("29");
      speciale_action(2,106)
       flags.seif= true;
      CreateWindow(150,250,"205",3,nil,250,23);
      -- --playeffect("01");
      Set_Cursor(65,3);
      SetCurrentRM("menu");
      AddImgToBook("photoaparat",821,637);
      AddHints()
      SetCurrentRM("main");
      flags.card=true;
      SwitchToSheet("re");
      savegame(SaveLevel());
    return;end;
  return;end;
  if sender==36 then
    clear_satelite_leaf("kabinet");
  return;end;
    if sender==26 then
  if id==100 then
  set_visible_object(5001,true)
  end;
  return;end;
  if sender==10 then
    SetAlfaValue(27,0);
  SetAlfaValue(28,0);
  SetAlfaValue(29,0);
  SetAlfaValue(3,0);
  SetAlfaValue(250,0);
  flags.proideno= true
  -- set_visible_object(6000,false);
  set_visible_object(5000,false);
  set_visible_object(5001,false);
  set_visible_object(5100,false);
  speciale_action(2,6000,true);
  -- speciale_action(2,5000,true);
  -- speciale_action(2,5001,true);
  -- speciale_action(2,5100,true);
  speciale_action(2,5 );
  speciale_action(2,10);
  speciale_action(2,15);
  speciale_action(2,11);
  speciale_action(2,6 );
  speciale_action(2,16);
  speciale_action(2,13);
  speciale_action(2,18);
  speciale_action(2,7 );
  speciale_action(2,21);
  speciale_action(2,19);
  speciale_action(2,20);
  speciale_action(2,25);
  speciale_action(2,26);
  speciale_action(2,3 );
  speciale_action(2,12);
  speciale_action(2,17);
  speciale_action(2,8 );  
  Set_Cursor(22,4);
  Set_Cursor(3,3);
  Set_Cursor(250,3);
  finish_mini_game(false)
  return; end;
  if sender==37 then
     skipping=true;
  return;end;  
  if sender==100 then
    if not help then
    if not flags.proideno then
      CreateWindow(200,200,"1",100,"messageinfo",30,50)
      -- --playeffect("01");
      help=true;
    end;
    end;
  return;end;  
    if pause_state then
    if sender==1 or sender==6 or sender==14 then
      pause_state=false;
      --set_visible_object(11111,false);
    end;  
  return;end;
  if sender==1 then
    if id==6000 then
      helpbtn=true;
  
    return;end;             
  if id==22 then
    StartTimer(2100,1);
    flags.minicomplete=true;
    BlockCursor(true);
  return; end;
  if id==3 then
    check_mini_game_zamok(19,0,4);
    speciale_action(2,3);
    speciale_action(2,250);
    flags.ru4ka= true;
        playeffect("18");    
  return; end;  
  
  if id == 11 then  
    check_mini_game_zamok(19,0,1);
    playeffect("23");
  elseif  id == 5 then
    check_mini_game_zamok(19,0,2);
    playeffect("23");
  ---------//кнопка 2
  elseif id == 6 then
    check_mini_game_zamok(20,1,1);
    playeffect("23");
  elseif  id == 10 then
    check_mini_game_zamok(20,1,2);
    playeffect("23");    
  -------//кнопка 3
  elseif id == 16 then
    check_mini_game_zamok(21,2,1);
    playeffect("23");
  elseif id == 15 then
    check_mini_game_zamok(21,2,2);
    playeffect("23");
  end;
    if id==5000 and skipping then
      if not flags.minicomplete then
        finish_mini_game(true);
      return;end;  
    return;end;
  if id == 1 then
  playeffect("17");
  if not flags.minicomplete then
    finish_mini_game(false);      
    DeleteResource("m_close");
    DeleteResource("m_ru4ka");
    DeleteResource("m_up_down"  );
    DeleteResource("m_zakrit");
    DeleteResource("m_otkrit");
    DeleteResource("m_fon"  );
    DeleteResource("m_cveta1");
    DeleteResource("m_podsvetka");
    DeleteResource("m_photoaparat");
    clear_satelite_leaf("kabinet");  
  return; end;
end;
  return; end;
if sender==6 then
  if helpbtn then
      CreateWindow(200,200,"1",100,"messageinfo",30,50)  
       -- playeffect("11");
       helpbtn=false;
  end;
  if flags.ru4ka then
    speciale_action(2,3);
    speciale_action(2,250);
    flags.ru4ka= false;
  return; end;
return; end;  
end;
function mini_delete ()

end;