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

function gameinput (sender,obj_id,attachedID)
Buttons_T(sender,obj_id)
CursorTreatment(obj_id,sender,attachedID);      
  if sender == 30 then

      DeleteResource("derevo_5" ); 
      DeleteResource("derevo_8" ); 
      DeleteResource("derevo_10");
      DeleteResource("derevo_11");
      DeleteResource("derevo_14");
      DeleteResource("derevo");
      DeleteResource("provolka");
    neighbors.jmp_prichal.lock=false;
    LoadLocation("jmp_prichal");        
    setcurentleaf("street",3,0);
    Block_Show_Cur(false);
    if flags.derevo then
      flags.help_derevo = true;
      speciale_action(2,6);
      speciale_action(2,9);  
      speciale_action(2,17)
      Set_Anim_Cur(17,15);
      StopEmiter("derevo");
      CreatePlashechka(900000,"3041")
    end;
  return;end;
  
  if sender==16 then
      if obj_id==12 then
       speciale_action(2,13,true,0.6)
      return;end;
      if obj_id==13 then
       speciale_action(2,14,true,0.6)
      return;end;
  return;end;
  
  if sender == 1 then
    if obj_id == 11 then
        if obj.pila ~= nil and attachedID == obj.pila.id then
          RemObjFromMouse()
          UnStoreObj(attachedID);
          Block_Show_Cur(true)
           flags.derevo = true;  
     --  StartTimer(8883,1);
          speciale_action(2,24)
          speciale_action(2,9);
          speciale_action(2,23);
        speciale_action(2,7,true);
          speciale_action(2,12,true,0.6)
         speciale_action(2,11,true,2);
         StartAnimation(7)
         StartTravel(7,1,nil,nil,MoveSaw);
         StartEmiter("benzopila");
         StartTimer(8882,2);
          playeffect("bsaw")
          Block_Show_Cur(true);
        return; end;
      if attachedID~=-1 and ((obj.pila~=nil and attachedID ~= obj.pila.id) or (obj.pila==nil ))  then
            RemObjFromMouse()
            CreatePlashechka(900000,"1000")
          return;end;        
          CreatePlashechka(900000,"116")
      return; end;
      CreatePlashechka(900000,"183")
  return ;end;
  
  
  if sender == 36 then

    if obj_id == 8882 then
      StopEmiter("benzopila");
      speciale_action(2,8,true);
      speciale_action(2,23,true);
      speciale_action(2,9,true);
      StartTimer(8883,1);
    return; end;
    
    if obj_id == 8883 then
      Block_Show_Cur(false);
     
      clear_satelite_leaf("street");
    return; end;

  return; end;

end
function SheetSwitched(nCount)
end;