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 == 100 then
    Block_Show_Cur(false);
    if flags.cod then
        Block_Show_Cur(true);
        clear_satelite_leaf("kabinet");
    end;
  return; end;
  
  if sender==36 then
    WaitRender();
  if obj_id==99883 then
     clear_satelite_leaf("kabinet"); 
  end;
  return;end;
  
  if sender==30 then
      DeleteResource("sh_big");
      DeleteResource("0215");           
      DeleteResource("0222");    
    setcurentleaf("kabinet",0,0);
    flags.help_open_shkaf_kabinet = true;
    if flags.shkaf   then
      if not  flags.shkafM then
          flags.shkafM=true
          speciale_action(2,21,true);
          speciale_action(2,22,true);
          Set_Anim_Cur(22,3);
      end;
      if not flags.cod then
          ActivateObject(21,true)
          Set_Anim_Cur(21,2);      
      return;end;
      ActivateObject(21,false)
      Set_Anim_Cur(21,3);          
    return; end;
  return;end;

  if sender==26 then
    if obj_id==900040 and flags.cod then
    clear_satelite_leaf("kabinet");   
           
    end;
  return;end;
  
  if sender == 16 then
    if obj_id == 4 then
      Block_Show_Cur(false);
      flags.shkaf = true;
      speciale_action(2,12);
      Set_Anim_Cur(7,3)
      Set_Anim_Cur(12,2)
    return; end;
  return; end;
  
  if sender == 1 then
    if attachedID~=-1 then
        RemObjFromMouse()
    end;
    if obj_id == 7 then
        speciale_action(2,7,true);
        playeffect("mini_doors");    
        speciale_action(2,4,true);      
        Block_Show_Cur(true);        
    return; end;
    if obj_id==12 then
        playeffect("journal")
        flags.books_open = true;
        Set_Anim_Cur(12,3)
        speciale_action(2,12)
        speciale_action(2,8,true)
        speciale_action(2,6,true)
        Set_Anim_Cur(6,2)
    end;
    if obj_id==6 then
       flags.cod = true;
       CreatePlashechka(900040,"599")
    end;
 return ;end;


end
function SheetSwitched(nCount)
end;