A former Holtsville man’s plan to kidnap his attorney — Suffolk Conservative Party Chairman Frank Tinari — may have been in the works for more than a year, according to evidence recovered from the defendant’s computer, a Suffolk police detective testified Wednesday.

Glenn Terry, 48, is on trial before state Supreme Court Justice Fernando Camacho, charged with second-degree attempted kidnapping and several weapons offenses.

He is accused of driving from Florida in March 2015 with a 9 mm semi-automatic pistol, 50,000-volt Taser, 1.2 million-volt Zap stun gun, Rambo knife, pepper spray and handcuffs. Police say that after a traffic stop, he told them he was on his way to abduct Tinari from outside his Central Islip office and stash him in a small room in his father’s basement.

StoryAttorney asks to quit kidnap attempt caseStoryProsecutors: Man plotted lawyer’s kidnappingSee alsoRecent LI mug shots

Tinari won a $450,000 settlement for Terry, who had sued an oil company after he fell into a bathtub of scalding water and got burned. Terry, however, felt he deserved much more.

Detectives say he told them he moved to Florida in March 2014 so that he could legally acquire the weapons he needed to kidnap Tinari.

But a forensic examination of Terry’s Toshiba laptop showed he was visiting sites like stungunbuyersguide.com and beststungun.com as early as January 2014. He also used Yahoo to search for how to “knock somebody out,” Det. Rory Forrestal testified Wednesday in Central Islip.

advertisement | advertise on newsday

The online searches continued after Terry moved to Port Charlotte, Florida, Forrestal said during questioning by Assistant District Attorney Peter Timmons.

In May 2014, Forrestal said the computer was used to search for whether a stun gun is legal in New York and how long it would take to purchase one legally. A month later, the computer was used to search for “how much clothing does a stun gun penetrate,” the detective said.

By March 25, 2015, when Terry drove north to Long Island with his dog and weapons collection, Forrestal said Terry had visited about 100 stun gun-themed Web pages.

At the same time, Forrestal said Terry’s computer was used to look up information on Tinari. Police found the laptop in Terry’s Bohemia hotel room after his arrest.

Forrestal also examined Terry’s Garmin GPS and was able to plot his drive north and his movements on March 27, the day he was arrested. Forrestal said the GPS showed Terry’s car went to Tinari’s office at 8:36 a.m. and lurked near the front of the building for almost an hour before leaving.

Terry earlier told detectives he had done just that, hoping to tackle Tinari and duct-tape his mouth. But Tinari testified earlier this week that he used the building’s rear door and parking lot.

At 12:13 p.m., Terry left the hotel again. Six minutes later, the GPS showed him stopped by the side of the road, pulled over for traffic infractions.

After officers noticed a Taser cartridge in his car, they say Terry told them about his other weapons and that he was on his way to try again to kidnap Tinari.