When a Wilmington man in his early 20s overdosed on heroin the day after Christmas, local police Detective Pat Nally turned to his computer. He wanted to look at the deceased's Facebook and MySpace pages for possible clues about the source of the drug and who might have been using it with the man.

"People arrange to buy and sell drugs on Facebook; there's talk of what they may do and where they may go," said Nally. "We'd be foolish not to use it as an investigative tool."

The Wilmington investigator is not alone. In an informal survey of 14 departments in this area, officials in half of them said they use social networking websites such as Facebook and MySpace in detective work - particularly in investigations involving young people.

In Harvard, the police signed on to such sites about three years ago, after a woman was sexually assaulted and beaten by three men whom she met on MySpace and invited to her house. Police contacted MySpace and tracked the assailants using their online usernames and accounts, said Chief Edward Denmark.

Now even the chief has a Facebook page himself.

In a recent photo he used in his profile, Denmark appears as a singer from the 1970s with an Afro, long sideburns, and a flashy necklace. It's not him: Denmark says he changes the photo daily.

Harvard Police Officer Daniele Fortunato is also on Facebook. If you had searched for her on the site recently, you would have found a cat in a white-and-red Christmas hat stretching out on a bed (it's her profile photo), while Harvard police Sergeant James Babu appears as a smiling pig, with big ears and perfect white teeth.

Since the MySpace incident, the department has found that such websites can be useful to help identify suspects, Denmark said, by providing information about a particular person's contacts.

"We ask them if they know a certain person and [if] they tell us 'no' and we look on Facebook and see that they're friends, we know they're being untruthful," he explained.

In Nashua, police Sergeant Mike Carignan said Facebook helps police identify suspects by making it possible to "put a face to a name." He said the department uses such sites in investigations involving sexual predators, burglaries, drug dealers, and wanted people.

In Boxborough, Sergeant Warren Ryder said police were able to prevent underage drinking at a high school graduation party using information they obtained on Facebook. "They were talking about who was going to get the booze first," he said.

He said police also solved a vandalism case after someone posted a picture of the spray-painted graffiti on Facebook.

In Lowell, police Captain Randell Humphrey said Facebook can be useful in cases involving computer crimes, such as threats, as well as fraud and sex-related crimes, while Woburn even employs a detective whose responsibility is to monitor Facebook and MySpace.