MARTINEZ — A Walnut Creek optometrist took photos with a disposable camera to commemorate a two-day arson spree that damaged several businesses in downtown Walnut Creek last year, a prosecutor told jurors Tuesday in opening statements at the doctor’s trial.

Scott Weinberg, 52, of Walnut Creek, has pleaded not guilty by reason of insanity to four counts of arson in connection with the September 2009 fires at the Comcast office on Arroyo Way, Wendy’s restaurant on North Main Street and inside a large trash bin outside West America Bank on North California Boulevard.

Weinberg’s attorney, John Forsyth, chose not to make an opening statement, which would have revealed Weinberg’s defense. Civil court records, however, indicate that Weinberg has a long history of bipolar disorder marked by episodes of “unpredictable” behavior. Weinberg worked as a doctor at For Your Eyes Only on Ygnacio Valley Road in Walnut Creek for three years before abruptly leaving the practice in July 2009, two months before his arrest.

If jurors find him guilty of the charges, there will be a second trial as to whether he was legally insane at the time of the fires.

Deputy district attorney Simon OConnell said Weinberg started the fire in the trash bin outside the bank Sept. 22, 2009, immediately after staff members told him they were releasing him as a customer based on his recent withdrawal history. OConnell said bank staff members saw him lingering next to the bin just before it erupted in flames, then saw him watching the blaze from across the street. The fire was extinguished quickly and damage to the bin was limited.

The next day, the prosecutor said, Weinberg went to Comcast, which had recently canceled his cable service, and was captured on video surveillance urinating in the foyer, vandalizing placards and loitering near a bill drop-off box that became engulfed in flames. OConnell said Weinberg took a picture of a firefighter battling the blaze after questioning him about what happened.

He then went to Wendy’s, ordered food and said, “Viva Mexico” to employees and took their picture. Weinberg was caught on video breaking a green wood trellis in the parking lot, which he used to start a fire on the restaurant’s exterior wall, OConnell said.

Weinberg then returned to Comcast and started another fire that smoldered as police tracked him to his residence and arrested him that night, OConnell said. The blaze erupted early the next morning and destroyed the office’s interior, and knocked out Comcast service to 40,000 customers. OConnell said fire investigators determined that fire was started using a piece of green trellis.

“There is no doubt as to the guilt of Dr. Weinberg,” OConnell said Tuesday.

The trial continues this week with witness testimony in Contra Costa County Superior Court Judge John Laettner’s courtroom.

Weinberg remains held at County Jail in Martinez in lieu of $1.4 million bail.