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

function gameinput (sender,obj_id,attachedID)    
Buttons_T(sender,obj_id)
CursorTreatment(obj_id,sender,attachedID);     
  if sender == 30 then
      DeleteResource("trava2");
      DeleteResource("trava_all");
      DeleteResource("trava5");           
      DeleteResource("trava7");         
    setcurentleaf("tropa_obryva",16,0);    
    if flags.trava_skos and not flags.trava_skosM then
        flags.trava_skosM=true
        speciale_action(2,11);
        ActivateObject(3,true);
        Set_Anim_Cur(3,2)
    end;
    Block_Show_Cur(false);
    if flags.trava then
        if not flags.trava_skosM then
            flags.trava_skosM=true
            speciale_action(2,11);
        end;
        ActivateObject(4,false);
        Set_Anim_Cur(4,3)            
        ActivateObject(3,false);
        Set_Anim_Cur(3,3)        
      StopEmiter("trava");
    end;
  return;end;
  
  if sender==15 then
    if obj_id >= 10 and obj_id <= 12  then
        if flags.grass_10 and flags.grass_11 and flags.grass_12 then
            Block_Show_Cur(false)
            Set_Anim_Cur(6,4)
            for i=10,12,1 do
                Set_Anim_Cur(i,3)
            end;        
        else
            speciale_action(2,20,true,1);
        end;
    return;end;
  return;end;
  
  if sender==16 then
    if obj_id==20 then
      speciale_action(2,20,true,0.7);
      speciale_action(2,21,true,1);
      playeffect("kosa")
    return;end;
    if obj_id==21 then
      speciale_action(2,21,true,0.7);
      if not flags.grass_10 then
         flags.grass_10 =true
         speciale_action(2,10,true);
      return;end;
      if not flags.grass_11 then
         flags.grass_11 =true
         speciale_action(2,11,true);
      return;end;      
      if not flags.grass_12 then
          flags.grass_12 =true
         speciale_action(2,12,true);
         RemObjFromMouse()    
         UnStoreObj(obj.kosa.id);
         Set_Anim_Cur(obj.gruzik.id,4)
         flags.trava_skos=true;
      return;end;       
    return;end;    
  return;end;
  
  if sender==50 then
      Block_Show_Cur(true);
      StartTimer(8882,0.5);
  return;end;
  
  if sender == 1 then
    if obj_id == 2 then
      if attachedID ~= -1 then
        RemObjFromMouse()
      end;
      clear_satelite_leaf("tropa_obryva");
    return; end;
    if obj_id >= 10 and obj_id <= 12  then
    if obj.kosa~=nil and attachedID==obj.kosa.id then
        speciale_action(2,20,true,1);
        RemObjFromMouse()
        Block_Show_Cur(true);
    return;end;
    if attachedID~=-1 then
        CreatePlashechka(900000,"1000")
    else
    CreatePlashechka(900000,"2010")
    end;
    return; end;
    if obj_id ==6  and flags.trava_skos then
      RemObjFromMouse()
      flags.trava = true;
      StoreObj(obj.gruzik.id,obj_id,"362",335,350,"gruzik",290,217)
    return; end;
  return ;end;
  
  
  if sender == 36 then
    if obj_id == 8882 then
      
      clear_satelite_leaf("tropa_obryva");
    return; end;
  return; end;
  


end
function SheetSwitched(nCount)
end;