local need_all = 0;
function Buttons_T(sender,obj_id)
    ButtonTreatment(obj_id,10001,10002,10003,CloseBtnX,CloseBtnY,34,34,sender,"mayor_yard",false) 
end; 

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

  if sender == 30 then
      DeleteResource("yaschik");
      DeleteResource("jashik3");
      DeleteResource("jashik9");      
      DeleteResource("jashik6");
      DeleteResource("lopata");      
    setcurentleaf("mayor_yard",6,0);
    Block_Show_Cur(false);
    if flags.box_loc6_open and not flags.box_loc6_openM then
        flags.box_loc6_openM=true
        speciale_action(2,2);
        speciale_action(10,2)
    end;
    if flags.jashik then
      flags.help_lopata_bagor = true;
      if not flags.box_loc6_openM then 
      flags.box_loc6_openM=true
      speciale_action(2,2);
      end;
      ActivateObject(3,false);
      Set_Anim_Cur(3,3);
      StopEmiter("pogarbox");
    end;
  return;end;
  
  if sender==50 then
        StartTimer(8882,0.5);
        Block_Show_Cur(true);
  return;end;
  
   if sender==1 then
    
    if obj_id == 8 then
      if obj.tvrtk ~= nil and attachedID == obj.tvrtk.id then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        speciale_action(2,7,true,1);
        Block_Show_Cur(true)
      return; end;
      if attachedID~=-1 and ((obj.tvrtk~=nil and attachedID ~= obj.tvrtk.id) or (obj.tvrtk==nil ))  then
        RemObjFromMouse()
        CreatePlashechka(900000,"1000")
      return;end;          
      CreatePlashechka(900000,"115")
    return; end;
    

    
    if obj_id == obj.lopta.id  then
      RemObjFromMouse()
       flags.jashik = true;    
      StoreObj(obj.lopat.id,obj_id,"113",335,350,"lopata",247,228)
      speciale_action(2,10);
    return; end;

  return ;end;
  
  if sender == 16 then
  
    if obj_id==7 then
      if counter<3 then
        counter=counter+1;
        playeffect("screwdriver")
        speciale_action(2,7,true,0.7);
        speciale_action(2,19,true,1);
      return;end;
            speciale_action(2,7,true,1);
            speciale_action(2,8,true);    
            speciale_action(2,18,true);            
    return;end;
    
    if obj_id==19 then
        counter=counter+1;
        speciale_action(2,7,true,1);
        speciale_action(2,19,true,0.7);    
    return;end;
    
    if obj_id==18 then
          speciale_action(2,18,true,1);
          speciale_action(2,6,true);
          speciale_action(2,10,true);
           Set_Anim_Cur(8,3)
          speciale_action(2,obj.lopta.id,true);  
          Set_Anim_Cur(obj.lopta.id,4)
          flags.box_loc6_open=true;
          Block_Show_Cur(false)        
    return;end;
   
  return; end;
  
  if sender == 100 then

  return; end;
  
  if sender == 36 then

    if obj_id == 8882 then
      Block_Show_Cur(false);
        
      clear_satelite_leaf("mayor_yard");
    return; end;

  return; end;

  
end
function SheetSwitched(nCount)
end;