local fFirstTime = true;

skip = false;
function mini_create ()
    show_help_wnd=true;
    init_mini(true);
    create_mini(3,156,95,120,120,1010,4,2,4,4);
    StartTimer(88821,0.5)
end;

function SkipActions()
    SkipMini()
    finish_mini_game(true);
    playeffect("miniok")
    HideSkip()
    HideHelp()
    StartTimer(88850,2);
    Block_Show_Cur(true);
end;
function Buttons_T(sender,id)
   ButtonTreatment(id,10001,10002,10003,CloseBtnX,CloseBtnY,CloseWidth,CloseHeight,sender,"secret_room",true)
   ButtonTreatment(id,10021,10022,10023,HelpBtnX,HelpBtnY,HelpWidth,HelpHeight,sender,"secret_room",true,145,200,200)
   if skip then
    ButtonTreatment(id,10011,10012,10013,SkipBtnX,SkipBtnY,111,31,sender,"secret_room",true)
   end;  
end; 
function gameinput (sender,id,attachedID)
 CursorTreatment(id,sender,attachedID); 
 Buttons_T(sender,id)
   
  if sender == 100 then
    StartTimer(88811,1);
  return; end;
  
  if sender == 36 then      
    if id == 88811 then
      Block_Show_Cur(false);
      CreatePlashechka(900000,"145")
    return; end;
    if id == 88850 then      
      Block_Show_Cur(false);
      flags.pjatnashki = true;  --------------------------------------------------
      clear_satelite_leaf("secret_room");
      finish_mini_game(true);      
    return; end;

  return; end;
  
  if sender == 30 then 
    DeleteResource("pjathashki1");
    DeleteResource("pjathashki2");
    DeleteResource("pjathashki4");       
    setcurentleaf("secret_room",7,0);
    Block_Show_Cur(false);    
    if flags.pjatnashki then --------------------------------------------------------
      fromPyatnashki=true;
      WaitRender()
    return; end;
  return; end;
  
  if sender==37 then
    skip = true;
  return;end;
  
  if sender == 10 then
    playeffect("miniok")
    HideSkip()
    HideHelp()
    StartTimer(88850,2);
    Block_Show_Cur(true);
  return; end;
 
  if sender == 1 then
       if attachedID ~= -1 then
        RemObjFromMouse()
      end;      

    if id >= 1010 and id <= 1025 then
        check_mini_game_money_pation(id,fFirstTime);
        fFirstTime = not fFirstTime;
        if fFirstTime then
           playeffect("block")
        end;
    end    
  return; end;

end;

function mini_delete ()

end;
function SheetSwitched(nCount)
end;