function mini_create ()
  show_help_wnd=true;
  init_mini(1);
  create_mini(21,7,5,7,false,191,108,65,45,455); -- Корова бык
  -- create_mini(8128);
  -- finish_mini_game(true);
end;
--function mini_msg_proc (id)
function gameinput (sender,id,attachedID)
  if sender==30 then
  FreeCustomCursor(122);
  setcurentleaf("gallery",6,0);
    flags.nohints=false;
    if flags.minicomplete13 then
      playeffect("29");
      DeleteElement("gr",9);  
      collaps_obj(16,0,0,10,0); --получаем карандаш
      playeffect("20");

      Set_Cursor(703,3);
      savegame(SaveLevel());
    return; end;
  return; end;
  
  if sender==10 then
    flags.minicomplete13=true;
  CreateWindow(200,250,"41",1,"m&i",63,107,"lastik2",246,13);
  return; end;
  if sender==37 then
     skipping=true;
  return;end;    
  -- if sender==26 then

  -- return; end;
  
  if sender==100 then
    if not help then
      CreateWindow(200,200,"1",100,"messageinfo",30-9,50-15)
      --playeffect("01");
      help=true;
    end;
    if newcursor then
        PrevCursor = objectid+4165
      SetCustomCursor(objectid+4165); 
      --speciale_action(2,objectid+4165)
    --  add_to_mouse(id);
        
      newcursor = false;    
    return;end;
    if  check_CAB then
        check_CAB=false;
      SetObjectPosition(objectid,objectx[objectid],objecty[objectid])  
      speciale_action(2,objectid);
      PrevCursor = 122
      SetCustomCursor(122);
      fGame=false;
      objectid=0;
    return;end;
  return;end;
  if sender==26 then
    if id==100 then
  set_visible_object(5001,true)
  end;
    if id==1 then
    clear_satelite_leaf("gallery");
  return;end;
    if id==2 then
      flags.minicomplete19=true;
      clear_satelite_leaf("gallery");
    return; 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==6 then
    if helpbtn then
       CreateWindow(200,200,"1",100,"messageinfo",30-9,50-15)
       playeffect("11");  
      helpbtn=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.minicomplete then
        finish_mini_game(true);
      return;end;  
    return;end;
--messageboxi(id);
  if id==650 then
    playeffect("17");  
    finish_mini_game(false);
    FreeCustomCursor(122);
    clear_satelite_leaf("gallery");
    DeleteResource(    "m13_close"   );
    DeleteResource(    "kraski"   );
    DeleteResource(    "m13_fon"   );
    DeleteResource(    "m13_marks"   );
    DeleteResource(    "m13_kisti"    );
    DeleteResource(    "m13_notes"   );
    DeleteResource(    "lastik2" );
  return;end;
    if id==6000 then
       CreateWindow(200,200,"1",100,"messageinfo",30,50)
         playeffect("11");  
    return;end
    if id==5000 and skipping then
      if not flags.minicomplete8 then
        finish_mini_game(true);
      return;end;  
    return;end;
  if id>=455 and id<=461 then
      fGame=true;
      objectid=id;
      --speciale_action(2,PrevCursor)
      FreeCustomCursor(PrevCursor);
      SetObjectPosition(PrevCursor,2000,2000)
      newcursor=true;
      WaitRender();
    end  
  return; end;

-- return; end;
  if sender==8129 then
    if id>=191 and id<=191+5*65 and attachedID>=108 and attachedID<=108+7*45 then
    if fGame==true then
    playeffect("chpok");    
        playeffect(9);  
      speciale_action(2,objectid);
      check_mini_game_CAB(objectid);
      check_CAB=true;
      FreeCustomCursor(PrevCursor);
      SetObjectPosition(PrevCursor,2000,2000)
      WaitRender();
    end;  
    return; end;
  return; end;  
  -- if id==122 then
    
    -- add_to_mouse(id);
    -- objectid=id;  
  -- return;end;
  
  
  
  -- if sender==1 then
  -- if id>=555 and id<=561 then
--  if objectid==122 then
    -- set_pos_in_img(122,(id-555)*118,0,118,162)
    --RemoveFromMouse(objectid);  
    --SetObjectPosition(objectid,470,374)
    --speciale_action(2,objectid)
    -- objectid1=id+100;
    --speciale_action(2,objectid)
    --add_to_mouse(objectid);  
    -- fGame=true;      

  --return;end;
  -- return;end;
  -- return;end;
  
    
end;
function mini_delete ()

end;