function mini_create ()
  show_help_wnd=true;
  init_mini(1);
  create_mini(19,6,30,115,98,812,470,659,1,7,0,-1);
  -- flags.nohints=true;
  -- create_mini(8128);
  -- finish_mini_game(true);
end;
--function mini_msg_proc (id)
function gameinput (sender,id,attachedID)

  if sender==30 then
  BlockCursor(false);
    setcurentleaf("barton_vhod",1,0);
      flags.nohints=false;
  if flags.minicomplete16 then      
    flags.address = true;
    CreateWindow(150,250,"260",nil,nil,250,30);
          --playeffect("01");
    playeffect("29");
    DeleteElement("gr",102);
    StopEmiter("pu4ok");
    AddParticleToObject(66,"dver",581,262);
    MoveEmiter("dver",581,262);
    if not flags.door then
      StartEmiter("dver");
    end;    
    savegame(SaveLevel());
  return;end;
  return; end;
  
  if sender==10 then
    flags.minicomplete16=true;
    StartTimer(2100,1)
    BlockCursor(true);
  return; end;
  if sender==37 then
     skipping=true;
  return;end;
    if sender==26 then
  if id==100 then
  set_visible_object(5001,true)
  end;
  return;end;
  if sender==36 and id==2100 then
    clear_satelite_leaf("barton_vhod");
  return;end;  
  if sender==100 then
    if not help then
      CreateWindow(200,200,"2",100,"messageinfo",30,50)
      --playeffect("01");  
      help=true;
    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==5000 and skipping then
      if not flags.minicomplete16 then
        finish_mini_game(true);
      return;end;  
    return;end;
  if id==650 then
     playeffect("17");  
    finish_mini_game(false);
    DeleteResource(    "m16_close"       );
    DeleteResource(    "m16_fon"     );
    DeleteResource(    "listiki"     );
    DeleteResource(    "m16_lenta"     );  
    clear_satelite_leaf("barton_vhod");
  return;end;
      if not flags.minicomplete16 then    
        if id>=659 and id<=664 then --нажимаем на часть телеграммы
          add_to_mouse(id);
          mousepresed=true;
          objectid=id;
        return 0; end  
      return;end;
  return; end;
  
  if sender == 6 --Отпустили левую кнопку мышки
  then  
    if helpbtn then
       CreateWindow(200,200,"2",100,"messageinfo",30,50)
        playeffect("11");    
      helpbtn=false;
    end;
    if not ok then
    if mousepresed==true
    then
    playeffect("gorwok");
      RemoveFromMouse(objectid);
      check_mini_game_puzzle(objectid);
      mousepresed=false;
      objectid=0;
    end
    return; end;
  return; end;
  
    
    
end;
function mini_delete ()

end;