JERUSALEM, July 10 (JTA) — Two weeks after the abduction of Cpl. Gilad Shalit, hardline rhetoric on both sides suggests that Israel and the Palestinians are on course for a major military showdown. But the public posturing could be part of a covert negotiating process: Egypt and Turkey are both trying to mediate and, according to some reports, a deal acceptable to both sides may be shaping up. Both Israel and Hamas have good reasons for wanting to cut a deal. But they also have strategic goals that could prolong the fighting. Israeli Prime Minister Ehud Olmert spoke of “a war for which it is impossible to set a timetable,” and the head of the Israel Defense Forces’ Southern Command Chief, Maj.-Gen. Yoav Galant, said it could take months. There was tough talk on the Palestinian side, too: Khaled Meshaal, Hamas’ Damascus-based leader, insisted Monday that Shalit would be released only in a swap for Palestinian prisoners in Israeli jails, an exchange Israel refuses to contemplate for fear that it would encourage more kidnappings. Briefing the Cabinet Sunday, Defense Minister Amir Peretz outlined Israeli goals that could lead to an extended campaign. Operation Summer Rains, he said, has three strategic aims: freeing Shalit, stopping Kassam rocket fire on Israeli civilians and dealing Hamas a decisive political and military blow. The last of these goals, inhibiting Hamas’ capacity to make war, means destroying arms caches, tunnels and workshops where Kassam rockets are produced and targeting Hamas militiamen. In optimal conditions, all this would take time. But there are certain time constraints on Israeli action — fear for Shalit’s life, unwillingness to exacerbate humanitarian conditions in Gaza and a need to maintain international support — all of which dictate a slow and careful modus operandi. Hamas also has strategic goals that could prolong the crisis. According to Israeli intelligence, Hamas aims to humiliate Israel by forcing a prisoner exchange that would establish the organization as a major regional player and convince Israelis that the unilateral disengagement Olmert plans for the West Bank is not feasible. On the tactical level, the IDF wants to draw out Hamas militias and engage them in battle, while Hamas wants to stay hidden and suck Israeli forces deeper and deeper into Gaza. This also makes for a time-consuming stand-off. On the other hand, both Israel and Hamas stand to gain from an early deal. Israel would get Shalit and a Hamas commitment to a long cease-fire, including a cessation of Kassam rocket fire. The government, particularly Olmert and Defense Minister Amir Peretz, would gain in prestige. Hamas, for its part, would get Palestinian prisoners, Israeli recognition that the group can’t be ignored, an end to targeted assassinations of leading terrorists and adulation on the Palestinian street. Egyptian and Turkish mediators are working on plans along these lines. According to former Palestinian Authority Foreign Minister Nabil Shaath, the Egyptian plan is staggered to make it more palatable to the Israelis. In the first stage, the Palestinians would release Shalit and in return Israel would call off its military campaign and withdraw forces from Gaza. Both sides then would declare a long-term cease-fire, including the cessation of Kassam rocket fire and Israeli targeted killings; finally, at a later date, Israel would release Palestinian prisoners as a gesture to P.A. President Mahmoud Abbas and Egyptian President Hosni Mubarak. That momentum could lead to talks on a permanent peace deal between Israel and the Palestinians and the establishment of a Palestinian state, Shaath says Over the weekend. P.A. Prime Minister Ismail Haniyeh called for an end to hostilities based on a similar plan, but he reversed the order: First Israel would withdraw in return for a total cease-fire, and only then would the two sides begin negotiations on Shalit’s release. When Israel rejected this proposal out of hand, Meshaal called a press conference in Damascus to reiterate that there would be no deal unless Israel released Palestinian prisoners. Where Haniyeh, ensconced in Gaza, sounded like a man desperate to stop the Israeli military advance, Meshaal seemed full of confidence that Hamas would win in the end. The outcome of the power struggle between Haniyeh and Meshaal — or between Hamas leaders in the territories and those abroad — could determine how long the Israeli offensive continues. There are differences on the Israeli side, too. Some Cabinet ministers and generals maintain that Olmert and Peretz, civilians with little military background, are moving too slowly on the military front. The generals see the thrust into northern Gaza to stop the Kassams as just the beginning of a much larger operation to smash Hamas militias, and want a green light to move as soon as possible. Olmert and Peretz retort that injudiciously increasing military pressure could endanger Shalit’s life. So far they’ve been able to stand up to generals champing at the bit to commit greater forces to the fighting. The two leaders also can claim some success: Hamas reportedly has lost around 50 fighters, and, according to some reports, is already running out of Kassams. Still, some Cabinet ministers also are unhappy with the government’s careful approach. One of the most outspoken critics is Internal Security Minister Avi Dichter, a former head of the Shin Bet security service. Dichter says the government should immediately order the army to stop the Kassam rocket fire, using whatever means necessary. He also suggests that Olmert consider a modified disengagement plan, evacuating West Bank settlements but leaving behind soldiers to quash any resurgence of terrorism. Dichter’s formula would lead to an immediate escalation in fighting, but possibly to a shorter campaign. The differences in the Israeli and Palestinian camps highlight the central paradox of Summer Rains: Given the two sides’ strategic aims, which aren’t easy to achieve, the crisis could drag on for months. But precisely because of the mutual distaste for a protracted operation, ongoing mediation attempts could just succeed, against all odds.