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

function gameinput (sender,obj_id,attachedID)    
Buttons_T(sender,obj_id) 
CursorTreatment(obj_id,sender,attachedID); 
  if sender == 30 then
      DeleteResource("kamin2");
      DeleteResource("kamin"); 
      DeleteResource("kamin7");      
    setcurentleaf("mayor_house",8,0);
    Block_Show_Cur(false);
    if flags.kamin_mayor then
      StopEmiter("kamin_stat");
      speciale_action(2,50,true,2);
      speciale_action(2,51,true,2);
      speciale_action(2,52,true,2);
      MoveObjectX(24,605,680,2)
      Block_Show_Cur(true)
      AddParticleToObject(49,"kartina_house",642,185);
      MoveEmiter("kartina_house",642,185);
      StartEmiter("kartina_house");
    end;
  return;end;
  

  
  if sender == 1 then

    if obj_id == 6 then
      if obj.stdwa ~= nil and attachedID == obj.stdwa.id then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        speciale_action(2,3,true);
        flags.odna_stat = true;
        playeffect("statue")
        if flags.dwa_stat then
          playeffect("srabotalo")
           flags.kamin_mayor = true;
          StartTimer(8881,0.5);
        end;
      return; end;
      if obj.totem ~= nil and attachedID == obj.totem.id then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        speciale_action(2,4,true);
        flags.dwa_stat = true;
        playeffect("statue")
        if flags.odna_stat then
          StartTimer(8881,0.5);
           flags.kamin_mayor = true;
          playeffect("srabotalo")
        end;
      return; end;
      if attachedID~=-1 and ((obj.totem~=nil and attachedID ~= obj.totem.id) or (obj.totem==nil ))  then
        RemObjFromMouse()
        CreatePlashechka(900000,"1000")
      return;end;    
        CreatePlashechka(900000,"245")      
    return; end;
  return ;end;
  
  if sender == 16 then
    if obj_id == 5 then
      StartTimer(9882,1);
    return; end;
  return; end;
  
  if sender == 100 then

  return; end;
   if sender==44 then
    AboutItem(obj_id)
  return;end;  
  if sender == 36 then
    if obj_id == 8881 then
      Block_Show_Cur(true);
      speciale_action(2,5,true);
    return; end;

    if obj_id == 9882 then
      Block_Show_Cur(false);
     
      clear_satelite_leaf("mayor_house");
    return; end;

  return; end;

end
function SheetSwitched(nCount)
end;