BERN (Reuters) - Switzerland and the European Union, its main trading partner, made headway on Thursday on clinching a new treaty meant to cement ties, and Bern pledged fresh contributions to EU coffers. The head of the EU Commission, Jean-Claude Juncker, and Swiss President Doris Leuthard gave an upbeat assessment of ties, which are on the mend after the Swiss parliament last year skirted voters  calls for curbing immigration from the bloc.  Things are going in the right direction,  Juncker told a news conference after meetings in the Swiss capital.  Shaky prospects for progress in the talks had prompted last-minute consultations on Monday to check whether the visit would even take place, a diplomat involved said. But Leuthard said Switzerland was on track to contribute another 1.3 billion Swiss francs ($1.33 billion) in  cohesion payments  to the EU budget over 10 years as a sign of solidarity. Legislation would go to parliament next year. The two sides did not achieve a breakthrough on a  framework  treaty Brussels wants to replace more than 100 bilateral accords now governing relations. This would ensure Switzerland adopts relevant EU laws in return for enhanced access to the bloc s single market, crucial for Swiss exports.  Such a pact is anathema to the anti-EU Swiss People s Party (SVP), the biggest in parliament. Many conservative politicians as well worry that any deal giving EU judges a role in settling disputes plays into the SVP s hands before 2019 elections.  They hope Britain s divorce talks with Brussels may open new avenues for Swiss-EU ties. While Britain seems set to leave the single market and to impose controls on immigration, Switzerland is keen to ensure EU citizens can continue to live and work here   the price for its  enhanced access to the EU market. Juncker said he was taking pains to ensure the Brexit issue and Swiss talks remained separate. Leuthard said the foreign judges issue remained a tricky one but added:  We found some flexibility here and will go into this in more depth in the months ahead.  She did not elaborate. Bilateral ties suffered when Swiss voters in 2014 demanded quotas on EU immigration, but thawed after parliament last year adopted instead a system giving people registered as unemployed in Switzerland first crack at open jobs. Agreements on mutual recognition of industrial standards and combining carbon trading systems followed, and Brussels is expected soon to recognize Swiss financial rules as sufficient. A new treaty could pave the way for heightened Swiss access to EU power markets, cutting costs and ensuring supplies in emergencies. It could also help open the EU market for financial services for Swiss-based banks and insurers. The EU has made clear the treaty is a precondition for such deals, which in theory could make a pact more attractive to Swiss voters in an inevitable referendum. Without accompanying perks, the treaty is  a sitting duck , one EU diplomat said. While a treaty is also a stated aim of the Swiss government, mainstream conservatives are wary of the  foreign judges  angle.  They worry this hands the SVP a stick with which to beat them. A survey this month by gfs.bern for Credit Suisse showed 60 percent of Swiss back the current web of bilateral accords, down sharply from 81 percent in 2016. Support for ending the accords rose 9 points to 28 percent. The survey reflected how contradictory Swiss wishes can be. Nearly 80 percent favor quotas to control immigration, while 85 percent want free access to foreign markets. The SVP has mounted a referendum campaign to scrap the bilateral accords and seize control of immigration to a country whose population is already a quarter foreign.  ($1 = 0.9799 Swiss francs) 