* Centre-left Social Democrats set to win most votes
* President Zeman has major role in post-election haggling
* Social Democrat chief Sobotka far from assured of PM seat
By Jan Lopatka
PRAGUE, Oct 23 (Reuters) - The Social Democrat party likely to take power in the Czech republic after an election this weekend could be destabilised by an internal battle over who becomes the next prime minister.
Bohuslav Sobotka is leader of the party and, on paper at least, is on course to head the next government, as long as he can form a coalition with smaller parties to give him a majority in parliament.
That scenario could be upset, though, by a rivalry between Sobotka and Czech president Milos Zeman dating back to a vote among lawmakers 10 years that foiled Zeman's first attempt to become president.
Zeman has the right to appoint the prime minister and while he may not veto Sobotka outright, he could use his allies within Sobotka's party to undermine his rival and pick someone else.
Party officials, who spoke on condition of anonymity, said personal tensions were being put aside during the election campaign. But they could be reignited afterwards, when the issue of who becomes the next prime minister is being decided.
An internal battle could prolong the formation of a new government and deter foreign investors who value the country's relative stability.
While Zeman remains popular, some Czechs feel he is overstepping the limited powers of the presidency. Artist David Cerny spoke for that constituency this week by erecting a 10-metre statue on a pontoon on the Vltava river in Prague, showing a purple hand giving a giant middle finger sign toward Zeman's office at Prague Castle.
POWER TO APPOINT PM
Opinion polls show that the Social Democrats will be the biggest party after the election on Friday and Saturday.
But they will fall short of a majority of seats in parliament and the process of putting together a government with one or more smaller parties will be influenced by Zeman who has the legal power to appoint prime ministers.
"Certainly Zeman will try to get someone more to his taste into the prime minister's office," said Jiri Pehe, a political analyst and director at the New York University in Prague. "I would not bet on Sobotka becoming the prime minister."
The president is a 68-year-old heavy smoker with a self-confessed taste for alcohol. The party leader, in the job since 2010, is a 42-year-old former finance minister with a sober, studious image.
Zeman has shown warmer feelings towards deputy chairman Michal Hasek, who once ran against Sobotka for party leadership and has shown allegiance to Zeman. At a party congress in March, Zeman greeted Hasek with a hug and Sobotka with a handshake.
Analysts and rivals say Zeman, who left the party after the presidential fiasco in 2003 and won the country's first direct presidential vote this year, is using Sobotka's opponents to win control of the Social Democrats and boost his power base.
In July following the collapse of a centre-right government over a graft scandal, Zeman ignored advice from parties and appointed a caretaker cabinet filled with personal allies, some of them former Social Democrats from 1998-2002, when he led a leftist government.
Hasek backed Zeman's plan against Sobotka's wishes, and in the end forced him into a U-turn.
Zeman has said the Social Democrats should propose for prime minister a leader who wins the most individual votes in the election, under a system that allows Czechs to support individual candidates on the ticket of a party they vote for.
"It (the party) would be silly not to do that because it should follow the will of the voters," Zeman said in August.
In the 2010 election, the Social Democrat with the most votes was Hasek.
Trying to put the issue to rest, Sobotka called a vote of the party's leadership on his candidacy in August. He won only 57 percent and had to deny rumours he contemplated resigning.
"The only thing that surprised me was how some people in the party do not care about our election success but pursue their personal benefit," he said.
Hasek has campaigned alongside Sobotka but also said last week the party needs to make amends with Zeman.
"I want to fill in the gulf between him and the Social Democratic Party. The country needs a leftist government that will not make war with a leftist president due to silly personal vanity," he said.
Sobotka said last week he is hopeful the election will show that his party is calling the shots on the political left.
"If the Social Democrats are clearly dominant in the election and beat both the Zemanites and the Communist Party, the matter will be clear," he said in a video interview. (Additonal reporting by Robert Muller; Editing by Christian Lowe/Ruth Pitchford)