Media playback is unsupported on your device Media caption The controversial practice of shackling mentally ill patients persists in Indonesia's Galuh Foundation

All around a compound at the Galuh Foundation there are men and women lying on wooden platforms that are doubling up as makeshift beds.

Many of them have been chained to their beds.

One man does push-ups in the corner, his feet tied by iron ropes to the side of his bed.

Another plays with the links on the chain, talking to himself, oblivious to the people around him.

Tucked away in a suburb of Jakarta, Galuh is a home for Indonesia's mentally ill.

It's not easy to find - hidden down a dirt road, behind a bunch of shacks and a horse shed.

When you enter, it's like walking back into the dark ages, leaving modern Indonesia behind.

The people who work at Galuh say at any given time about 10% of the 280 residents here are shackled - but they say it's for their own good.

I spot Ii in the corner. The young man sits quietly, with an almost yogic expression of calm on his face.

Wearing only a pair of shorts, he says nothing, does nothing, just sits. He has been shackled in Galuh for two weeks.

Terrible stench

Jaja Sudrajat, one of the workers at Galuh, told me Ii had only been put in chains temporarily.

"We use these chains just to be careful," he told me as he showed me around the foundation.

"We don't use any medication or anything like that, so when he's calmed down then we will let him out. He was also put in chains in his house and he's been to the psychiatric hospital, but he's always escaped - so his family brought him here."

We let them out of these chains every few days or so - once they stop being dangerous to themselves and others we let them out Jaja Sudrajat, Galuh Foundation

But workers at Galuh insist they do not practice shackling - known locally as pasung. The practice has been banned in Indonesia since 1979, and the Indonesian government launched a campaign in 2011 to eliminate it once and for all.

"We don't practice pasung," said Mr Sudradjat. "If we did, then these people wouldn't be able to move altogether.

"But we let them out of these chains every few days or so. Once they stop being dangerous to themselves and others we let them out.

"Then we put them back into the chains. It all depends on their mood."

The stench in Galuh is overwhelming, a mixture of human urine and faeces. As lunch is served, one of the workers sprays away the human waste with a hose, and inevitably people are hit by the splashes of the dirty water.

In the middle of the compound, there is a giant cage with huge metal grilles.

The cage is locked. Inside, there are about 30 or 40 people - many of them also chained, and without any clothes on. It is a depressing, disturbing place.

But it is also a place that is supported by the Indonesian government.

Galuh gets $10,000 in funding every year from the social welfare ministry, but the people who work here say that money covers fewer than half of the patients here.

Prayers and herbs

The foundation was started in 1994 by a man named Gendu Mulatip, who believed in a combination of prayer, herbal treatments and chaining people temporarily to cure them.

He died in 2011 but now his son Suhanda runs the place. He boasts of his success rate - but can't say specifically how many people he has cured.

"There are a lot of people with a variety of illnesses here," Mr Suhanda tells me.

"We treat them with herbal concoctions made of leaves and then we mix it with coconut water. It makes them calm.

"Doctors use sleeping pills, we use this - we don't depend on medication.

"And praise God, we've seen people healed from this, and we are happy with the results. But we can't say what our success rate is here, because people come and go."

Galuh has been criticised by Indonesia's medical community for not using modern methods to treat its patients.

We deeply regret these conditions - but when I talk to these foundations, they think shackling is the best method for their patients. Diah Setia Utami, Director of mental health, health ministry

Nina Mardiana, Galuh's secretary, acknowledges there are problems with the foundation but says it needs more help from the government.

"I hope it will be better here in the future," she told me.

"None of our workers have any medical training. We just diagnose people based on what we think is wrong with them.

"We have told the government that we need some basic medical training, so that we can identify the diseases that people here have."

Difficult problem

The BBC approached Indonesia's health ministry to find out why the government is funding an institution that still uses shackling when it has committed to eliminating it.

"Well in the first place, it is not the health ministry that funds Galuh - that's the social welfare ministry's job," said Diah Setia Utami, director of mental health at the health ministry.

"Of course we deeply regret these conditions. 2014 is our deadline for getting rid of shackling in Indonesia - but when I talk to these foundations they think shackling is the best method for their patients.

"And families still send their mentally ill relatives there. So it is a very difficult problem to fix."

For many Indonesians, seeing a family member afflicted with a mental disease is frightening and confusing - as it is for people around the world. But there is relatively far less information about mental illnesses in Indonesia than there may be in other, more developed countries.

Many uneducated Indonesians who live in rural areas believe that these ailments are a result of being the victim of a curse, or black magic.

With little or no education about mental illnesses, many resort to the practice of shackling, despite the fact that it's been banned for decades.

Enlightened approach

But there are some hospitals in Indonesia that are trying to treat the country's mentally ill properly.

Dr Asmarahadi is one of 14 psychiatrists at the government run Suharto Heerdjan hospital.

Our culture is to blame - people come to the mental hospital as the last resort Dr Asmarahadi, Psychiatrist

The ministry of health says there are about 800 trained psychiatrists in the country, and 34 dedicated mental health institutions in Indonesia.

Dr Asmarahadi says its not just that there aren't enough hospitals or doctors - it's also the stigma attached to mentally ill patients that makes it so challenging to treat the disease.

"Trained psychiatrists like me are losing out to the witch doctors and spiritual teachers," he told me.

"We need to get the message out to people that mentally ill patients can be treated with medication, and can live normal lives. People think that with medication they will turn into shells of themselves, and not be able to have sexual relations with their partners. That's not true. "

Dr Asmaharadi admits that the problem isn't one Indonesia can solve overnight.

"It's very challenging," he said. "Most of the people that come here have generalised anxiety problems, or schizophrenia.

"We can cure them with medication. But by the time they come here for many of them it's too late.

"Our culture is to blame - people come to the mental hospital as the last resort after they have spent all their money on witchdoctors, shamans and faith-based healing centres."

Faith alone cannot help the likes of the people at Galuh.

Stripped of their dignity, they're locked up and caged like animals

Experts say between 1% and 5% of Indonesia's 240 million population is struggling with a mental illness - and that's just the figure from recorded cases.

There could be many more out there, but because of a lack of data there's just no way of telling.

Indonesia says stamping out shackling is a priority - but admits it will miss its 2014 target.

That's little comfort for the country's mentally ill, whose ranks are growing year by year.