BANGKOK (AP) — The exactingly planned five-day funeral for Thailand's King Bhumibol Adulyadej will be governed by strict protocols for how the public and media conduct themselves that are as much about honoring the monarch as they are about controlling a delicate political moment.

The detailed prescriptions for appearance and behavior show a particular concern for what images of Thailand and its royals are circulated during and after the elaborate ceremonies, which include Bhumibol's cremation on Thursday evening.

Thais are known for a highly emotional adulation of Bhumibol, which palace officials assiduously cultivated over his 70-year reign, but the funeral will be an intensely somber event, intentionally drained of possibilities for spontaneity.

Only state-controlled TV can provide a live broadcast, and police have prohibited screen-printing of pictures of Bhumibol and his magnificent golden-colored cremation pyre on T-shirts and the like.

The crowds of mourners who'll squeeze into Bangkok's historic royal quarter starting Wednesday will be a sea of black attire. They will be permitted to prostrate in silence when the royal procession passes, but must not shout "Long Live the King" or hold up cellphones to take selfies with the procession in the background.

Besides considerable security, an army of volunteers will be on hand to police behavior.

"If people act inappropriately, volunteers must be psychological and speak to them with soft voices to avoid violence," said Sansern Kaewkumnerd, a spokesman for the military government in power since a 2014 coup.

Because of Thailand's tropical climate, umbrellas, hats and sunglasses will be allowed, but they must be black or similarly muted and taken off to show respect to the royal procession when it passes.

"The bigger issue going on here is that spontaneity means lack of control, and if there is anything the current regime wants to avoid, it is disorder or any evidence that they are not in control," said Tamara Loos, a professor of Southeast Asian studies at Cornell University.

The Oct. 13, 2016, death of the 88-year-old Bhumibol, known as Rama IX as the Chakri dynasty's ninth monarch, sparked a national outpouring of grief and a year of mourning.

The affection he inspired was in part the result of decades of work by palace officials to rebuild the prestige of the monarchy, which had lost much of its influence after a 1932 coup ended centuries of absolute rule by Thai kings.

As a unifying symbol, Bhumibol earned genuine respect in a nation frequently rocked by political turmoil. But even the current military government's aggressive use of a draconian lese majeste law and online censorship has been unable to paper over divisions that find an outlet in criticism of the monarchy as the apex of a society in which the army has ousted elected governments twice since 2006.

"This long five-day ceremony is the precise moment when authorities would want to control any negative responses to King Bhumibol and the memory of his reign," said Loos.

"I could see real violence happening if there were protests against the monarchy during this moment because people are emotional," she said. "And nothing could be worse for Thailand now than to have bloodshed during the funeral ceremony."

Thailand's army on Tuesday detained a political activist, Ekachai Hongkangwan, after he wrote on Facebook that he planned to wear a red shirt on Thursday, a color-coded nod to supporters of the democratically elected governments ousted in the 2006 and 2014 army coups.

Requirements for journalists, and especially photographers, are particularly precise and outlined in a three-page document that includes a full page of additional regulations set by special branch police.

Formal dress requirements that are typical for close quarters contact with members of the royal family include a prohibition on earrings, beards or mustaches for men, and unnatural hair coloring for women.

Photographers must bow or curtsy before and after taking photographs of the new king and other members of the royal family and cannot approach closer than 5 meters (yards), or 10 meters if using a flash that must not exceed 1,500 watts.

Journalists are confined to specific stands, and the special branch police's instructions for how they take photographs are designed to preserve regal dignity: no photographs of royals while they are ascending or descending between levels, such as while walking on stairs; no photographs directly in the face while they are seated; no photographs of royals eating.

Michael Montesano, coordinator of the Thailand Studies Program at the Institute of Southeast Asian Studies in Singapore, said the ceremonies are a goodbye to Bhumibol but also show an attempt to set the tone for the reign of his son, King Maha Vajiralongkorn Bodindradebayavarangkun, who has had far less contact with ordinary Thais than his father.

Montesano said Bhumibol's high-profile trips during his reign to the Thai countryside and efforts to improve the living standards of villagers earned him goodwill and became elevated to mythic levels through palace efforts to restore a sense of mystery to the monarchy.

"These two things go hand in hand," he said. "One of the questions is where this notion of a sacred monarchy, a monarchy with some mystery to it, and all this ceremony will fit into the way the monarchy really operates during the next reign."