Every day, patients undergo the most modern of treatments in the operating rooms of Jerusalem's Shaare Zedek Hospital. And every weekend, during their recovery, patients have come to rely on the "grama switch," a contraption designed according to a millennia-old concept. The problem for the hospital, which strives to observe Halacha, lies in discovering methods that make it permissible for religious employees and patients to perform tasks on Shabbat in a manner that does not violate Jewish law. For example: turning on a light or pressing a buzzer that indicates a patient needs attention would be forbidden, as a long-understood extension of the biblical prohibition against igniting a flame on Shabbat. That's where the grama switch comes in. Based on the Talmudic ruling that a grama - Aramaic for "indirect action" - can be employed on the Sabbath by those in great need, the switch releases a small flap outside the door, exposing an already lit bulb that, in turn, alerts a nurse to the patient's call. Result: problem solved, religious principle preserved. Similarly, the hospital uses a specially-designed telephone that does not complete an electrical current, and a writing pen for doctors that prevents the sin of writing on Shabbat because its ink disappears in a few days. THE GADGETS are the product of unique work by the Institute of Science and Halacha, founded and run by Rabbi Levi Yitzhak Halperin to bridge the gap between modern, "secular" science and the 2,000-year-old Talmudic laws that dictate Orthodox behavior to this day. The roots of the institute - a small, humble building that faces Mount Herzl in Jerusalem and houses a small collection of rabbis and engineers - stretch back nearly half a century. Then, in the early days of the state, the fundamental question of whether it is possible to run a modern society in accordance with Jewish law was becoming especially poignant. In Palestine before 1948, religious Jews often relied on non-Jews to carry out much of the labor on Shabbat that is necessary for a large community to function in the modern world. When the State of Israel arose - with a Jewish majority tasked with continuously maintaining such basic amenities as water and electricity, and such essential services as security, hospitals and certain industrial processes of great importance to the economy - many Orthodox religious leaders were simply not equipped with the scientific and technical knowledge to provide educated guidance for the new challenges. Halperin and a group of fellow kollel members decided to broaden their knowledge in order to confront these challenges. Once a week, the young men invited scientists and engineers to teach them, and the kollel members would reference related Jewish sources to build a more symbiotic relationship between the different disciplines. After almost nine years of these sessions, Halperin founded the Institute for Science and Halacha. "Just like the size of a window determines how much light can enter a room," Halperin explains, "the scope and diversity of contemporary reality determines the extent to which the light of Torah can permeate the world. It is the goal of the institute to bring together the new developments of the world today - chemistry, biology, electronics, etc. - and the world of Halacha." The institute has since then gone far afield in this pursuit - so far, in fact, that it was even consulted when Israel's first astronaut, Ilan Ramon, of the ill-fated Columbia crew of 2003, wanted to know how to make kiddush for Shabbat while in space - where sunrise and sunset occur about every hour and a half. (The answer: figure out when Shabbat would have started at the launch pad and count from there.) ASIDE FROM the arena of public service, the Institute for Science and Halacha is frequently approached by companies from the secular world for help in dealing with halachic solutions to technical problems, so they can also include observant Jews among their clientele. "They are the bridge between many Israeli businesses and the haredi world," says Yitzhak Steinberg, whose import company utilizes the technology of the institute. "They are unique in that they have the knowledge of both the technology and the Halacha. This allows religious Jews to also take advantage of progressive technology." The institute recently helped design an innovative refrigerator featuring a microchip that can be programmed so that on Shabbat, its compressor and motor operate automatically, rather than starting when the door is opened. It also helped El Al, Israel's national airline, handle the issue of how a kohen - who, according to Jewish law, is forbidden from being in the same enclosure with a dead body - can be on a flight whose cargo includes bodies of Jews from abroad that are sent to Israel for burial. "The first thing we do is define what the issue is," says Rabbi Shmuel Strauss, director of Lehava, the educational branch of the institute. "When Rabbi Halperin finds something new [i.e. a novel approach to a particular Halacha], he writes letters to authorities to ask them to argue with him - whomever he feels has a handle on the issue - and to convince him - if they don't agree with the use of a particular concept in a particular context - why he is wrong." While Halperin's work is primarily in Israel, he is consulted by Jews from around the world whose behavior is governed by Halacha. As Strauss puts it, "When push comes to shove and you need an extra opinion, you come here." WHEN COMPANIES do seek such opinions, they often look to another, very similar place: the Zomet Institute in Gush Etzion. Through the concept of "modulating existing currents," Zomet has produced the metal detectors used at security sites such as the Western Wall, as well as automated elevators, electric wheelchairs and alarm and sound systems - all of which can be used on Shabbat while in uninterrupted use. Zomet also invented water heating and cooling systems for hotels that operate in such a way that no one is responsible for cooking or cooling water on Shabbat. Zomet is also very involved with projects for the army. Their uniquely designed jeeps and security vehicles contain Shabbat-permissible electronic systems which control the ignition, gas consumption, outside lights and other functions. Furthermore, searchlights, cameras, tape recorders and other devices have been adapted for permitted Shabbat usage. Rabbi Israel Rosen founded Zomet in 1988, after working at the Institute of Halacha and Science for several years; he left, he says, because "they didn't want to touch a lot of things." "Our guiding force is more Zionistic and more open," says Dan Maran, the executive director of Zomet. "We do not look for a consensus on every issue... Our goal is how something can be permitted, in an independent Jewish way." Although they have differences, Zomet and the Institute of Science and Halacha are making a difference. Both are carrying the ancient ideals of the Talmudic sages into the present, creating practical solutions to modern-day problems with inspiration from ancient Jewish law. "It all begins with faith," Rosen maintains. "If you don't believe in the goal, you won't succeed."