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

function gameinput (sender,obj_id,attachedID)    
CursorTreatment(obj_id,sender,attachedID); 
Buttons_T(sender,obj_id)   
  if sender == 30 then
      DeleteResource("krugka_water");  
      DeleteResource("krugka_water_6");     
      DeleteResource("krujka");          
    setcurentleaf("prichal_turmy",12,0);    
    Block_Show_Cur(false);
    if flags.krugka_water then
      StopEmiter("water_kêugka");
      speciale_action(2,10);
    end;
  return;end;
  
  if sender == 1 then

    if obj_id == 7 then
      if obj.kruga ~= nil and attachedID == obj.kruga.id then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        Block_Show_Cur(true);
        playeffect("waterkr");
        Set_Anim_Cur(7,3)
        speciale_action(2,6,true,2);
      return; end;
      if attachedID~=-1 and ((obj.kruga~=nil and attachedID ~= obj.kruga.id) or (obj.kruga==nil ))  then
        RemObjFromMouse()
        CreatePlashechka(900000,"1000")
      return;end;      
      CreatePlashechka(900000,"446")
    return; end;
  return ;end;
  
  if sender == 16 then
    if obj_id == 6 then
      speciale_action(2,5,true,2);
      speciale_action(2,6,true,2);
    return; end;
    if obj_id == 5 then
      speciale_action(2,obj.krugaw.id,true,2);
      speciale_action(2,5,true,2);
      StartTimer(8882,1.5);
    return; end;
  return; end;

  
  if sender==50 then
    StartTimer(8883,1);
    Block_Show_Cur(true);
  return;end;
  
  
  if sender == 36 then
    if obj_id == 8882 then
    flags.krugka_water = true;
       StoreObj(obj.krugwa.id,obj.krugaw.id,"2015",285,350,"krujka",323,217)
      Block_Show_Cur(false);
    return; end;
    if obj_id == 8883 then
      
        Block_Show_Cur(false);      
      clear_satelite_leaf("prichal_turmy");
    return; end;
  return; end;
  

end
function SheetSwitched(nCount)
end;