CENTENNIAL, Colo. (AP) -- Witnesses presenting the most detailed portrait yet of last year's Aurora movie theater massacre are detailing sometimes paradoxical behavior by James Holmes, the man accused of the rampage.
At a hearing to determine whether Holmes should stand trial, detectives testified Tuesday that Holmes spent more than two months assembling an arsenal for the assault on a midnight screening of "The Dark Knight Returns."
The former neuroscience graduate student bought his tickets nearly two weeks before the July 20 massacre. He also rigged an elaborate -- and potentially deadly -- booby-trap system in his apartment to distract police from the carnage at the theater, though the trap was never sprung, they testified.
Holmes showed less focus after police arrested him as he stood outside the theater, clad in body armor. He played with the paper bags they placed on his hands to preserve gunpowder evidence, pretending they were puppets, Aurora Det. Craig Appel testified. Holmes tried to jam a staple into an electrical outlet.
Holmes' lawyers were expected to present an insanity defense. They have previously stated that Holmes, 25, is mentally ill. Defense lawyer Tamara Brady pointedly asked a federal Bureau of Alcohol, Tobacco, Firearms and Explosives agent in court Tuesday whether any Colorado law prevented "a severely mentally ill person" from buying the 6,295 rounds of ammunition, body armor and handcuffs that Holmes purchased online.
There is not, the agent replied.
Defense attorneys have indicated they might present witnesses during this week's hearing to describe Holmes' mental health.
On Tuesday, the case was dominated by the litany of Holmes' preparations. Law enforcement officers said Holmes' first recorded purchase was of two tear gas grenades, ordered online May 10.
Holmes also bought two Glock handguns, a shotgun and an AR-15 rifle, along with 6,295 rounds of ammunition, targets, body armor and chemicals, prosecutors said. The magnitude of the attack was captured in the first 911 call, played Tuesday in court, that police said recorded at least 30 shots in 27 seconds.
He dyed his hair bright orange, then bought a scope and non-firing dummy bullets on July 1, the visit and the new hair color documented in security video.
Finally, he purchased glycerin and potassium permanganate -- chemicals that could combine to create fire -- from a Denver science store. At some point, he also improvised napalm, as well as thermite, a substance which burns so hot that water can't extinguish the blaze.
Holmes' purchases were for two planned attacks, prosecutors said -- the theater shooting and the booby-trapped apartment that would have blown up if anyone had entered.
The bottle of glycerin was meant to fall into the permanganate when the door to his apartment opened, to cause an explosion and then a fire, prosecutors said.
Parts of Holmes' carpet were soaked with gasoline and oil, and ammonium chloride, a white powder, was poured onto the floor in strips, FBI bomb technician Garrett Gumbinner said.
"It would have ignited and the whole apartment would have exploded or caught fire," Gumbinner said.
He said the rig had two other initiating systems. One was a pyrotechnics firing box that would have been triggered by the remote control unit of a toy car left along with a boom box set to play loud music. Gumbinner said Holmes told him he hoped the music would lure someone and lead them to play with the car, thereby detonating the explosives.
The other was a model rocket launch box that operated by means of infrared light, but Holmes told investigators it wasn't armed, Gumbinner said.
The attempt at a distraction speaks to a plan to escape, but the traps weren't triggered. Holmes, clad from head to toe in body armor, was found standing by his car outside the theater. He told investigators that the booby-trapped apartment was an effort to pull police away from the theater. He didn't expect to see officers so quickly.
Police said he volunteered information about the booby traps. Authorities went to the apartment and carefully dismantled them.
Prosecutors also used Holmes' dating website profiles to try to prove he knew the consequences of his planned actions. On two social networking websites -- Match.com and FriendFinder.com -- Holmes asked: "Will you visit me in prison?"
The Match profile was created in April; the FriendFinder account was opened on July 5. Holmes last accessed the sites two days before the shooting, detective Tom Welton testified.
Defense attorney Daniel King asked Appel if Holmes was tested for drugs or other substances.
"I saw no indication that he was under the influence of anything," Appel said.
Holmes' lawyers could have waived the first public airing of the case against him, but legal analysts say they may see the mini-trial as a chance to gauge the prosecution's case or tactics to prepare for a possible plea agreement.
Cases rarely advance to this stage without a judge agreeing to set a trial.
If Holmes is found sane, goes to trial and is convicted, his attorneys can try to stave off a possible death penalty by arguing he is mentally ill. Prosecutors have yet to say whether they will seek the death penalty.
If he's found not guilty by reason of insanity, he would likely be sent to the state mental hospital, not prison. Such a defendant is deemed not guilty because he didn't know right from wrong and is therefore "absolved" of the crime, said former Jefferson County District Attorney Scott Storey.
Last year, Bruco Strong Eagle Eastwood was acquitted by reason of insanity of attempted first-degree murder in the wounding of two eighth-graders outside a school not far from Columbine High School. Eastwood is spending time in a mental hospital. His case will be reviewed every six months until he's deemed sane and released.
Associated Press writers Thomas Peipert, Nicholas Riccardi and Colleen Slevin contributed to this report.