skip = false;

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

function SkipActions()
    PairsCounter(1,1) 
end;



function mini_create ()
    show_help_wnd=true;
    init_mini(true);
    -- create_mini(8128)
    create_mini(1000,5,1,2000,500,false,1003);
    StartTimer(9090,2.2)
    Block_Show_Cur(true)
end;
function gameinput (sender,id,attachedID)
CursorTreatment(id,sender,attachedID);
Buttons_T(sender,id)
    
  if sender==33 then
    if id==8777778 then
      finish_mini_game(true);
      Block_Show_Cur(false);
    return;end;
 return;end;  

  if sender == 30 then
    DeleteResource("border1"  );         
    DeleteResource("Journals"    );    
    DeleteResource("fon"     );          
    
    if flags.mini_gourn then
    frommini_gourn=true
   
  setcurentleaf1("holl",1,0); 
  
    WaitRender()
    return; end;
  setcurentleaf("holl",1,0);
  return; end;
  
  if sender==37 then
    skip = true;
  return;end;
  
  if sender == 10 then

    flags.mini_gourn = true;
    flags.help_gournal = true;

    clear_satelite_leaf("holl");
  return; end;
  
  if sender == 1 then   
       if attachedID ~= -1 then
        RemObjFromMouse()
      end;   


    if id > 1002 and id <1013 then
      playeffect("journal")
      check_mini_game_memory(id);
      gameinput(39,id)
    return; end;
  return; end; 
   


  
  if sender == 36 then
    if id==678967 then
    --    SetHotPoint(1018,99,124)
        MoveByVector(1018,430,230,3,100);
        StartTimer(8889,3);        
    end;
    if id==9090 then
       Block_Show_Cur(false)
        CreatePlashechka(900000,"219")
    end;
    

    
    if id==8889 then
    StopRotate(1018)
    ScaleObject(1018,1,4,6,100,100)
    StartTimer(8887,1);        
    end;


    if id == 8887 then
      AddGlobalFade(8777778,0)
      SetAlfa(8777778,0,1,1)          
    return; end;
  return; end;
end;

function PairsCounter(nCount,Param1)  
  if Param1==1 then 
    playeffect("miniok")
    HideSkip()
    HideHelp()
    Block_Show_Cur(true);
    moving=true;
        for i=1013,1017,1 do
      -- set_visible_object(i,false)
       SetAlfa(i,1,0,0.0001)
        end;
        for i=1019,1022,1 do
    -- set_visible_object(i,false)
       SetAlfa(i,1,0,0.0001)
        end;     
        speciale_action(2,1008,true);
        speciale_action(2,1018,true);
    speciale_action(4,1018)
    StartTimer(678967,1.6)
  end
end;
function SheetSwitched(nCount)
end;