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

function gameinput (sender,obj_id,attachedID)   
Buttons_T(sender,obj_id) 
 CursorTreatment(obj_id,sender,attachedID);
  if sender == 30 then
      DeleteResource("kirpich_2");
      DeleteResource("kirpich");    
      DeleteResource("kirpich_6");     
      DeleteResource("kirpich_8");       
    setcurentleaf("kamera",18,0);    
    Block_Show_Cur(false);
    if flags.vilamato and not flags.vilamatoM then
        flags.vilamatoM=true;
        speciale_action(2,7);
        speciale_action(2,10);    
        Set_Anim_Cur(15,2)    
        StopEmiter("kirpich");
      AddParticleToObject(15,"kirpich",100,421);
      MoveEmiter("kirpich",100,421);
      StartEmiter("kirpich");        
    end;
    if flags.kirpich then
	Set_Anim_Cur(15,3) 
      ActivateObject(10,false);
      ActivateObject(15,false);    
        if  not flags.vilamatoM then
        flags.vilamatoM=true;
        speciale_action(2,7);
        speciale_action(2,10);        
        end;
        ActivateObject(15,false)
      StopEmiter("kirpich");
    end;
  return;end;
  
  if sender==50 then
   Block_Show_Cur(true);
    StartTimer(8883,1.5);
  return;end;
  
  if sender == 1 then

    if obj_id == 6 then
      if obj.lomato ~= nil and attachedID == obj.lomato.id then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        flags.vilamato=true;
        Set_Anim_Cur(6,3)    
        Block_Show_Cur(true);
        speciale_action(2,5,true);
        speciale_action(2,6,true);
      return; end;
      if attachedID~=-1 and ((obj.lomato~=nil and attachedID ~= obj.lomato.id) or (obj.lomato==nil )) then
            RemObjFromMouse() 
            CreatePlashechka(900000,"1000")
      return;end;          
      CreatePlashechka(900000,"449")
    return; end;    
    if obj_id == 8 then    
      RemObjFromMouse()
      flags.kirpich = true;
      StoreObj(obj.rabper.id,obj_id,"450",335,350,"perchatka",290,217)      
    return;end;    
  return ;end;
  
  if sender == 16 then
    if obj_id == 5 then
      speciale_action(2,4,true);
      speciale_action(2,5,true);
      playeffect("kirpich")
    return; end;
    if obj_id == 4 then
      speciale_action(2,4,true);
      speciale_action(2,8)
      Set_Anim_Cur(8,4)
    return; end;
  return; end;
  
  if sender == 15 then
    if obj_id == 4 then
      Block_Show_Cur(false);
    return; end;
  return; end;
  
  
  if sender == 36 then
    if obj_id == 8883 then
      
       Block_Show_Cur(false);
      clear_satelite_leaf("kamera");
    return; end;
  return; end;
  


end
function SheetSwitched(nCount)
end;