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

function gameinput (sender,obj_id,attachedID)    
if not flags.taburet then
    Buttons_T(sender,obj_id)
    CursorTreatment(obj_id,sender,attachedID);
end;
  if sender==30 then
      DeleteResource("tab_all1");
      DeleteResource("tab_all2");     
      DeleteResource("0237");
    setcurentleaf("holl",1,0);
    if flags.gvozdi and not flags.gvozdi_loc then
      flags.gvozdi_loc = true;
      speciale_action(2,6);
      Set_Anim_Cur(6,3);
      speciale_action(2,7);
      ActivateObject(7,true);
      Set_Anim_Cur(7,2);
      AddParticleToObject(7,"taburet",420,585);
      MoveEmiter("taburet",420,585);
      StartEmiter("taburet");       
    end;
    if flags.taburet then
      flags.help_taburet = true;
      playeffect("taburetka")
      Set_Anim_Cur(6,3);
      Set_Anim_Cur(7,3);      
      speciale_action(4,34);
      speciale_action(2,7,true);
      speciale_action(2,34,true);
    return; end;
  return;end;
  
  if sender==16 then
    if obj_id==21 then
     playeffect("molot");
     speciale_action(2,21,true,0.7)
     speciale_action(2,20,true,1)
    return;end;    
    if obj_id==20 then
      speciale_action(2,20,true,1)
      speciale_action(2,object);
      speciale_action(2,object+1);
      if i<3 then
      Block_Show_Cur(false);
      end;
    return;end;      
  return;end;
  
  
  if sender == 1 then
  
    if not flags.gvozdi then
    if obj_id == 14 then
      if obj.gvozd ~= nil and attachedID == obj.gvozd.id then
        i = 0;
        speciale_action(2,14,true);
        Set_Anim_Cur(14,3);
        speciale_action(2,13,true);
        speciale_action(2,5,true);
        Set_Anim_Cur(5,4);
        speciale_action(2,7,true);
        Set_Anim_Cur(7,4);
        speciale_action(2,9,true);
        Set_Anim_Cur(9,4);
        speciale_action(2,11,true);
        Set_Anim_Cur(11,4);
        speciale_action(2,12);        
        set_pixel_check(5,false);
        set_pixel_check(7,false);
        set_pixel_check(9,false);
        set_pixel_check(11,false);
        RemObjFromMouse()
        UnStoreObj(attachedID);
        flags.gvozdi = true;
      return; end;
      if attachedID~=-1 and 
      ((obj.gvozd~=nil and attachedID ~= obj.gvozd.id) or (obj.gvozd==nil )) 
      then
        RemObjFromMouse()
        CreatePlashechka(900000,"1000")
      return;end;      
        RemObjFromMouse()
        CreatePlashechka(900000,"212")
    return;end;
    return;end;
    
        
      if obj.molot ~= nil  and attachedID == obj.molot.id and (obj_id == 5 or obj_id == 7 or obj_id == 9 ) then
          Cur_Item=attachedID
          Block_Show_Cur(true);
          ActivateObject(obj_id,false)
          xg,yg=GetObjectPosition(obj_id);
          SetObjectPosition(21,xg+128,yg-71)
          SetObjectPosition(20,xg+24,yg-43)
          speciale_action(2,21,true,1)
          object=obj_id
          i = i + 1;
          if i == 3 then            
            RemObjFromMouse()
            flags.taburet = true;
            UnStoreObj(attachedID);
            StartTimer(8882,3);
          return; end;
      return; end;      
      if attachedID~=-1 and 
      ((obj.molot~=nil and attachedID ~= obj.molot.id) or (obj.molot==nil )) 
      then
        RemObjFromMouse() 
        CreatePlashechka(900000,"1000")
      return;end;      
    RemObjFromMouse()
    CreatePlashechka(900000,"604")
  return ;end;
  
  
  if sender == 36 then
    if obj_id == 8882 then
      
       Block_Show_Cur(false);
      clear_satelite_leaf("holl");
    return; end;
  return; end;

end
function SheetSwitched(nCount)
end;