Keeping Scotland in the United Kingdom is a bigger idea than independence, former prime minster Gordon Brown has insisted.

The ex-Labour leader set out his vision for the country's future as he attacked First Minister Alex Salmond's plans for Scotland to leave the UK.

Mr Brown called for legislation to make the Scottish Parliament a permanent and irreversible part of the how Britain is governed, claiming it was an "anomaly" of the legislation that established Holyrood that meant the UK Parliament could override it.

He also said that a written constitution, which the UK does not have, could be used to highlight the importance of pooling resources across the United Kingdom.

Mr Brown spoke out at an event in Glasgow organised by United With Labour, the party's campaign to persuade people to vote against independence in next year's referendum.

The speech came on the same day that First Minister Alex Salmond outlined his idea for a new Scottish constitution at an event in Fraserburgh, Aberdeenshire.

Mr Salmond's SNP is "trying to frame the debate" about the country's future so that independence is seen as the only positive choice and those who favour remaining in the Union are "simply negative", Mr Brown said.

"They want to create the impression the only debate in town is between their vision of independence and those people who oppose it," Mr Brown said

"But we have a vision too, and we have a big idea. We actually have a bigger idea than the idea they are putting forward."

He referred to Martin Luther King's famous speech from 50 years ago, saying: "Because he gave a speech that said 'I have a dream'' people remembered what he said, and that is the same thing about what we are saying now.

"We have a big idea. We believe Scotland is a nation. No one is more proud of being a Scot than I am. We believe Scotland should have its own parliament to make decisions about its own affairs. In fact, I believe we should be setting out in legislation that the Scottish Parliament is permanent, it's irreversible, it's indissolvable. It's part of the way we will run this country for the future forever more.

"But I believe also that we are part of something bigger."

He stressed the importance of pooling resources across the UK, saying this provides assistance to both areas and people in times of need.

This principle should be "set down very clearly as the purpose of the Union".

The Kirkcaldy and Cowdenbeath MP argued: "We pool and share resources and we do so so that we have equal economic, social and political rights for working people, for pensioners, for people in need of healthcare or unemployed people in need of a job, throughout the whole of the United Kingdom.

"I believe we should write this into the constitution, for the first time making it explicit that the purpose of the Union is not just defence security, is not just trading relationships, but to pool and share our resources for the benefit of working people, the elderly, children and families, in all parts of the United Kingdom.

"I believe it makes sense now, and is something we should have done in government, to write down in British law, that the purpose of the Union is to achieve these goals.

"I would also write in the British constitution that the Scottish Parliament is permanent, irreversible and indissolvable."

Mr Brown said Scotland benefits from the pooling of resources because while it has 8.6% of the UK population, it receives 9% of money spent on pensions, the same proportion as London, which has 13.5% of the population.

"We allocate resources not on the basis of nationality but on the basis of need," the former Labour leader said.

There would be "substantial risks associated with splitting up British pensions", he said.

Hitting out at the SNP, he said: "This is the party that says pensioners will be better off after independence but yet has set up a working party to look at the affordability of pensions."

Scotland receives £3 billion a year from corporation tax but Nationalist plans to cut the levy could see this reduced to £1.5 billion, he said.

"That is money taken from services. That is money you cannot spend on pensioners. That is money you cannot spend on education. That is money you cannot spend on welfare," Mr Brown argued.

Cutting corporation tax also risks creating a "race to the bottom" with different areas competing to undercut each other and set lower rates.

"The alternative to the pooling and sharing of resources across the United Kingdom is the divide and rule that comes from the race to the bottom."

His attack on the Nationalists continued, as he accused Mr Salmond's party of "running scared about the monumental change they are proposing to make without the evidence that it will meet the needs and aspirations of the Scottish people".

He also criticised plans to keep the pound as currency if Scotland left the UK, which would see interest rates continue to be set by the Bank of England.

This would mean decisions on issues such as this taken in the interests of the rest of the UK, without any Scottish input, Mr Brown argued.

The SNP is "so dogmatically wedded to the idea of a separate state, they are happy for all these decisions that would affect the people of Scotland to be made by the rest of the UK in the interests of the rest of the UK without any Scottish representation at all".

He insisted: "In the interests of the Scottish people, there's got to be Scottish representation in making these decisions within the UK."

Scottish First Minister Alex Salmond outlined his vision for independence to an audience in Fraserburgh,  at around the same time as Mr Brown's speech in Glasgow.

Like Mr Brown, he praised the achievements of the Scottish Parliament over the last decade, such as introducing free personal care for the elderly, free university tuition and the smoking ban.

But he said Scotland could do more with independence and outlined the SNP's plan for a constitution for an independent Scotland.

"Like 16 other nations in the Commonwealth, we propose to retain the monarchy but the people of Scotland will draft a new constitution," he said.

"The UK is currently the only country in the Commonwealth and the only country in Europe without a written constitution.

"A constitution is vital. It sets out the rights and liberties, protection of essential liberties of the people. I believe a written constitution can enshrine for all time the greatest Scottish tradition of all, the unshakable Scottish tradition that sovereignty lies with the people of Scotland."

He praised countries such as Denmark, Sweden and Norway which are "among the 10 most equal countries in the OECD (Organisation for Economic Co-operation and Development)", compared with the UK which is "now at the bottom of the league".

Mr Salmond outlined the economic choices that would be open to an independent Scotland, including establishing a Norway-style oil fund, attracting more foreign students and workers, cutting or abolishing air passenger duty (APD), and abolishing the "bedroom tax".

"The time is now to establish an oil fund creating stable public finances and ensuring natural resources benefit future generations as they have done in Norway," he said.

"People come to study in Scotland from all over the world. Instead of discouraging that, as the UK Government is doing, why not encourage it? Independence would allow us to attract even more students and skilled workers.

"PricewaterhouseCoopers have shown that reducing or abolishing APD would more than pay for itself, provided we had control of the additional revenues that came in from additional tourism and spending that creates VAT.

"I used to be an economist and it's the absolute holy grail of economists and politicians to reduce a tax and increase revenues."

An independent Scotland "would never have participated in an illegal occupation of Iraq or introduced something as socially regressive as the bedroom tax", he said.

He added: "Last Thursday in the House of Commons, thanks largely to the intervention of the SNP and Plaid Cymru MPs, we avoided a headlong rush to engagement in Syria by the skin of our teeth."

Commenting on Mr Salmond's words on Syria, Scottish Liberal Democrat leader Willie Rennie said: "To imply the deep-rooted Syrian conflict would be resolved by Scottish independence is a naive and simplistic approach to world affairs that makes me cringe.

"The House of Commons debate was a mature one that fully recognised the complexity of the challenge that we face. Of course, there was division on the issue but to suggest that an independent Scotland would see into the future with greater clarity and unanimity is difficult to accept."