The gemorah in the 4th perek of Megillah discusses whether it is permissible to sell a shul. If the shul is sold, you have to use the money for something with a greater kedusha because of ma'alin b'kodesh. The gemarah says that it is only ok with a shul that belongs to a k'far. But a shul belonging to a city can never be sold even by the zayin tuvei ha'ir b'ma'amad anshei ha'ir because since it was built with the intention that the people of the world will use it, it belongs to everyone.
The question my talmidim asked me is: How does the fact that the shul belongs to anshei ha'kfar allow one to sell? Doesn't the din of ma'alin b'kodesh still apply?
If you can help, then thanks and tizku la'mitzvos.
Perhaps the mechanism of selling a Shul so that it may be used -- and the money received may be used -- for any purpose, by selling it through the Shiv'ah Tuvei ha'Ir b'Ma'amad Anshei ha'Ir, works through a Tenai. That is, when the Shul was originally built, the people built it with the understanding that if everyone would get together, along with the leaders of the community, and sell it with intention for the Kedushah to depart, then the Kedushah indeed departs when it is sold. (It is similar to the concept of "Lev Beis Din Masneh Alehen" which we find in a number of places.)