The Toronto stock market closed lower Tuesday while Greece weighed on markets for a second day amid hopes that the country has arrived at a tentative deal to secure a second bailout to avoid bankruptcy.

The resource-heavy S&P/TSX composite index dropped 47.43 points, led by energy and mining sector declines, to 12,512.42.

The TSX Venture Exchange was off 0.89 of a point to 1,663.33.

The Canadian dollar rose 0.07 of a cent to 100.52 cents US as early strength in the American currency faded and oil and copper prices advanced.

U.S. indexes closed higher, helped along by a report from the U.S. government that job openings soared to the highest level in nearly three years in December.

The Dow Jones industrial average climbed 33.07 points to 12,878.2. The Nasdaq composite index rose 2.09 points to 2,904.08 and the S&P 500 index was up 2.72 points to 1,347.05.

Athens must secure a €130-billion bailout deal from the eurozone and the International Monetary Fund to avoid a March default on its bond repayments, which would cause havoc in the financial system.

But first Greek leaders had to agree on another series of harsh austerity measures.

Late Tuesday afternoon, a spokesman for Greece’s private creditors says Greek Premier Lucas Papademos will soon tell eurozone finance ministers the contents of a deal to reduce the country’s massive debt.

The fact that the Greek government will now brief the rest of the 17-nation eurozone on the deal is a sign that they believe a deal is now almost done.

The developments took place amid a general strike disrupting public services and thousands of protesters taking to the streets of Athens.

But analysts pointed out that the country’s doesn’t have much room to manoeuvre.

“Whether they like it or not, they are going to have to take it (new austerity measures) if they want to stick around (in the eurozone),” said Sik Mokhtari, market technician at CIBC World Markets.

“You can only throw good money after bad for so long…. They have no choice.”

Mokhtari also pointed out that the market was taking an opportunity to retrench following a strong start to the year.

The TSX is up about five per cent year to date as traders have grown more confident that the U.S. economy can avoid a recession. Also, signs that the Chinese government has been successful in slowing the economy sufficiently to blunt high inflation, raised hopes that China can ease lending requirements and encourage growth.

“Historically, the month of February, going back to the 1960s, is generally a subdued month,” Mokhtari said.

“People look at that kind of data and say to themselves, ‘OK, it’s a softer month, we’ve had a huge rally in stocks, let’s take some profit.”‘

Mining stocks took the biggest hit with the base metals component falling 2.27% as copper prices pared early losses and rose a penny at US$3.88 a pound. Teck Resources (TSX:TCK.B) lost 90 cents at C$41.60 and Ivanhoe Mines (TSX:IVN) dropped 40 cents to $16.64.

There was major dealmaking in the resource sector.

Mining giant Xstrata PLC and commodities dealer Glencore International PLC have agreed to merge in a US$90-billion deal that would create the world’s fourth largest natural resources group.

The combined company’s properties would include major nickel mining and refining businesses in Canada, where Xstrata subsidiary Xstrata Nickel owns the former Falconbridge nickel company in Sudbury, Ont.

The energy sector declined 1.23% even as the March crude contract on the New York Mercantile Exchange turned around and jumped $1.50 to US$98.41 a barrel. Prices had earlier been depressed on analyst estimates that crude inventories likely rose about 2.3 million barrels last week.

Crude supplies in the U.S. have increased for the past three weeks at a key Cushing, Okla., delivery point amid a mild U.S. winter.

Imperial Oil (TSX:IMO) gained 29 cents to C$47.34 while Canadian Natural Resources (TSX:CNQ) was down $1.76 to $38.52.

The gold sector was off about 0.4% as the April bullion contract shook off early losses and advanced $23.50 to US$1,748.40 an ounce. Barrick Gold Corp. (TSX:ABX) gained 23 cents to C$49.13.

Nevsun Resources Ltd. (TSX:NSU) shares fell $1.94 or 30.6% to $4.40 after the Vancouver junior miner said output from its key African gold mine in Eritrea will be half the amount originally expected.

Shares in Centerra Gold (TSX:CG), the operator of the largest gold mine in Kyrgyzstan, were up 48 cents to $19.20 as its workers in the Central Asian country went on strike in a demand for additional payments to a state social fund. Centerra said that it deems the work stoppage illegal and that their collective agreement is in force until the end of the year.

The industrials sector was positive as Bombardier Inc. (TSX:BBD.B) added nine cents to $4.75.

Research In Motion Ltd. (TSX:RIM) shares were ahead 12 cents to $16.65 despite an announcement by oilfield services provider Halliburton Co. that it will replace 4,500 company-issued BlackBerrys with Apple Inc. iPhones to help employees do their jobs more effectively in the field. A Halliburton spokeswoman said the company is switching because the iPhone does a better job of supporting company applications like Insite Anywhere, which displays information on well construction and completion.