This courtroom sketch shows James Holmes being escorted by a deputy as he arrives at a preliminary hearing in district court in Centennial, Colo., on Jan. 7. / Bill Robles, AP

by Gary Strauss, USA TODAY

by Gary Strauss, USA TODAY

CENTENNIAL, Colo. - An FBI explosives expert testified Tuesday that mass murder suspect James Holmes rigged his apartment with an extensive array of homemade bombs designed to decimate his apartment building and create a diversion from the July 20 shootings at a suburban Denver movie theater that killed 12 and wounded or injured nearly 60 more.

Testifying on the second day of Holmes' preliminary hearing, Garrett Gumbinner said Holmes booby-trapped his apartment with explosives and triggering devices that would be tripped when the front door was opened. The explosive devices included homemade napalm, thermite, and glycerin Holmes designed to mix with potassium permanganate, a mix of metal powder and oxides, igniting a fire or explosion. Holmes had also set up a detonator outside of his Aurora apartment building, hoping someone would come along and trigger the device, normally designed to control a remote-controlled toy car.

Gumbinner's testimony underscored the elaborate planning Arapahoe County District prosecutors contend Holmes used to carry out a premeditated massacre at Aurora's Century 16 Cineplex in the early hours of July 20. The preliminary hearing will determine if there is sufficient evidence to try Holmes on more than 160 charges of first degree murder and attempted murder.

Gumbinner detailed how Holmes rigged his apartment's entryway with fishing line, tied to a thermos bottle in the kitchen. When the door was opened, it was designed to knock over the thermos containing glycerin and positioned above a pan filled with potassium permanganate. When combined, the chemical reaction sets off sparks. Holmes apartment was filled jars of napalm and other incendiaries. Even the carpet was soaked with gasoline and oil, which set ablaze, would have intensified the carnage, Gumbinner said.

Police were alerted to his apartment by a neighbor who heard loud music Holmes had pre-programmed to play on his computer. Holmes also told arresting officers -- who found him in police style protective gear by his car at the rear of the theater -- that there were explosives at the apartment. Authorities later disarmed the devices without mishap.

Aurora Police detectives and Alcohol, Tobacco and Firearms (ATF) Supervisor Steven Beggs outlined a series of purchases Holmes made beginning on May 10, when he bought two teargas grenades online from an on-line supplier. He later purchased tactical gear, the chemicals used for explosives, nearly 6,300 rounds of ammunition and four weapons found at the theater; a semi-automatic assault rifle, pump-action shotgun, a laser-guided pistol and a second handgun in the weeks leading up to the shootings.

All of the items were purchased legally at Denver area stores or through Internet dealers from California to Maryland. Aurora Police Detective Craig Apple, who has supervised Holmes' case, later testified that 76 shots were fired in the theater, including 65 from the assault rifle, six from the shotgun and five from a Glock pistol. The weapons have the same serial numbers as those purchased by Holmes between May 22 and July 6, Apple said.

Apple also testified that following his arrest, Holmes acted irrationally at a detention facility, at one point, taking a staple from a desk and trying to insert it into wall electrical outlet. At another point, Holmes made puppet motions with his hands, which had been covered with bags before they were tested for gunshot residue.

Holmes' attorneys say their 25-year-old client, a University of Colorado doctoral program dropout, suffers from mental illness and have indicated they will mount an insanity defense. Holmes, who dropped out in June after failing an oral exam, was seeing a school psychiatrist.

But prosecutors -- who wrapped up the witness portion of their case late Tuesday -- summoned Aurora Police Detective Tom Wilton to testify earlier in the day that Holmes had shown premeditation not just by his weapons purchases, but when he opened accounts with online dating services match.com and AdultFriendFinder.com weeks before the shootings.

His dating profiles were headlined "Will You Visit Me In Prison?"

Wilton's testimony drew some snickers from the courtroom audience, which included shooting victims and family members. But Holmes, bound at the hands and feet and flanked by several armed sheriff's deputies, again sat impassively through testimony. Except for briefly rocking his chair in a sideways motion for a few minutes Tuesday afternoon, Holmes stared straight ahead.

Earlier in the hearing Tuesday, witnesses testified about some of the chilling 911 calls that came from the theater as the shooting began.

Detective Randy Hansen said there were 41 separate calls within the first few minutes of the shooting.

The first call to police played in court came from inside the theater from Kevin Quinonez at 12:38 a.m. Hansen said during the 27-second call he heard at least 30 gun shots. The call came in 18 minutes into the showing of The Dark Knight Rises.

Police also played a 911 call from Kaylin Bailey, the teenage cousin of 6-year-old Veronica Moser-Sullivan, the youngest person killed. Veronica's mother, Ashley Moser, was also shot. She miscarried after the shooting and is partially paralyzed. Bailey frantically called emergency dispatchers, who tried to talk her through administering CPR. As screams filled the theater, a panicked Bailey sobbed, said she couldn't hear and couldn't do it.

Some courtroom witnesses dabbed their eyes during the tape. Holmes stared straight ahead as the call was played, showing no emotion.