hint = false;
function Buttons_T(sender,obj_id)
    ButtonTreatment(obj_id,10001,10002,10003,CloseBtnX,CloseBtnY,34,34,sender,"kabinet",false)
end;

function gameinput (sender,obj_id,attachedID)    
Buttons_T(sender,obj_id)
CursorTreatment(obj_id,sender);

  -- if sender==154 then
    -- if flags.ShowTutorial then
	-- tutorialprocessing=false
    -- nexttutorial=true
    -- end;
  -- end;

  if sender == 100 then
  if not qwerty then
  qwerty=false
    Block_Show_Cur(false);
  StartTimer(900050,0.2)      
end;  
  return; end;
  
  
  if sender==30 then
      DeleteResource("p_0002");     
      DeleteResource("p_big");
      DeleteResource("p_0004");
      DeleteResource("p_0010");      
    setcurentleaf("kabinet",0,0);
  
    WriteToConsole("6 \n")
    if flags.posilka   then
          if not flags.posM then
            flags.posM=true
            speciale_action(2,9);      
          end;    
       if flags.medalyon then
            speciale_action(2,99);
            Set_Anim_Cur(99,3);    
            StopEmiter("posilka")
            fromMed=true;         
       end;
     end;
    WaitRender();
  return;end;

  if sender==50 then
    StartTimer(900040,1)
  end;
    
  if sender==36 then
    if obj_id==900040 then
  --    flags.fspatitem=true;
        clear_satelite_leaf("kabinet");     
    end;
  if obj_id==900050 then
    if  flags.ShowTutorial and nexttutorial and flags.mes_tutorial==2 then
       CreateTutorial("3057",142,25,0) --,21
	   tutorialprocessing=true
       nexttutorial=false
       flags.mes_tutorial=3;
    return;end;  
  end;  
  return;end;
  
  if sender==16 then
  
    if obj_id==19 or obj_id==18 then
        speciale_action(2,obj_id,true,1.2)
        speciale_action(2,obj_id-1,true,1.5)
    return;end;

    if obj_id==17 then
        speciale_action(2,17,true,1.2)
        speciale_action(2,16,true,1.5)    
        speciale_action(2,15,true,1.5)    
        flags.posilka =true;
        ActivateObject(15,true)
        Set_Anim_Cur(15,4);
        Block_Show_Cur(false)
    return;end;
  return;end;
  
  if sender==1 then
    if attachedID~=-1 then
        RemObjFromMouse()
    end;
    
    if obj_id==21 then
        if obj.nog ~= nil and attachedID == obj.nog.id then
          RemObjFromMouse()
          UnStoreObj(attachedID);
          Block_Show_Cur(true)
          Set_Anim_Cur(21,3);
          speciale_action(2,21)
          speciale_action(2,19,true,1.5)
--          playeffect("posilka")
        return; end;
        if attachedID~=-1 and ((obj.nog~=nil and attachedID ~= obj.nog.id) or (obj.nog==nil ))  then
            RemObjFromMouse()
            CreatePlashechka(900000,"1000")
          return;end;        
          CreatePlashechka(900000,"2012")
      return; end;

    
    if obj_id==15 then
        flags.medalyon=true
        StoreObj(obj.med.id,15,"2011",335,350,"med_o",280,220,400000)
        
    return;end;
    
  return;end;
  
end
function SheetSwitched(nCount)
end;