DENVER (AP) — The former graduate student accused in the deadly Colorado movie theater shooting was being treated by a psychiatrist at the university where he studied, the first indication that he may have sought help before the rampage that killed 12 people and wounded 58.

Attorneys for James Holmes, 24, made the disclosure in a court motion Friday as they sought to discover the source of leaks to some media outlets that he sent the psychiatrist a package containing a notebook with descriptions of an attack.

The motion said the leaks jeopardized Holmes' right to a fair trial and violated a judge's gag order.

Holmes' lawyers added that the package contained communications between Holmes and his psychiatrist that should be shielded from public view. The document describes Holmes as a "psychiatric patient" of Dr. Lynne Fenton.

The motion did not reveal when Holmes began seeing Fenton or whether he was being treated for a mental illness. Legal analysts expect Holmes' attorneys to use an insanity defense at trial. Holmes is scheduled to be arraigned Monday. A hearing on the new defense motion also is scheduled that day.

Calls to Holmes' lawyer and the state public defender's office were not immediately returned, nor was a message left with Fenton's office. A spokeswoman for the Arapahoe County prosecutor's office declined comment.

The University of Colorado's website identified Fenton as the medical director of the school's Student Mental Health Services. An online resume stated that she sees 10 to 15 graduate students a week for medication and psychotherapy, as well as 5 to 10 patients in her general practice as a psychiatrist. Schizophrenia was listed as one of her research interests.

Fenton was disciplined by the Colorado Medical Board in 2004 for prescribing herself Xanax while her mother was dying, state records show. She also was disciplined for prescribing the sleep aid Ambien and the allergy medicine Claritin for her husband, and painkillers for an employee who suffered from chronic headaches.

Fenton worked for the U.S. Air Force in Texas as an acupuncturist before joining the University of Colorado in 2005.

A 1998 Denver Post article quotes a Colorado acupuncturist named Lynne Fenton discussing how acupuncture could be used to enhance women's busts.

In the week since the July 20 attack at an Aurora movie theater, few details have emerged about Holmes' life — especially the year he spent as a graduate student in Colorado. Holmes enrolled in a doctoral program in neuroscience at the University of Colorado-Denver Anschutz medical campus in June 2011. He left without explanation in June.

University officials have refused to disclose much more about Holmes, citing an order from the judge barring them from releasing information that would "impede an ongoing investigation." Staff, professors and classmates have been mum about Holmes' life at the school.

Holmes' appearance at his first court hearing on Monday stunned the victims' families and fueled speculation about the state of his mental health. His hair dyed a shocking comic-book shade of orange-red, he looked sleepy and, at times, inattentive.

Prosecutors said they didn't know if he was being medicated. Friday's defense motion, however, was the first confirmation from the defense that Holmes was seeing a psychiatrist and that he had sent a package to the doctor.

The package was seized by authorities on Monday after it was discovered in the mailroom at the university. It's unclear if it was sent before the attack at the July 20 midnight showing of "The Dark Knight Rises" that left 12 dead and dozens of others injured.

Authorities said Holmes legally purchased four guns before the attack at Denver-area sporting goods stores — a semiautomatic rifle, a shotgun and two pistols. To buy the guns, Holmes had to pass background checks that can take as little as 20 minutes in Colorado.

Federal law bars from purchasing firearms people who have been found mentally defective by a judge or who have been committed to a mental health institution, said Benjamin Van Houten of the Law Center to Prevent Gun Violence.

States can impose additional restrictions, but Colorado does not.

"That is why it's important for states to look at going beyond federal law in this area," Van Houten said.

At a press conference earlier this week, university officials acknowledged that students in the neuroscience program are carefully monitored. They said a graduate student experiencing problems would normally be referred to student support services.

On Friday, 21 news organizations, including The Associated Press, filed a motion asking the judge to reverse his order sealing court records in the case. The news organizations claimed the order means even a complete list of court filings is kept secret.

District Court Judge William Blair Sylvester has ordered all motions by prosecutors and the defense be filed under seal so they cannot be inspected by the public. Sylvester also ordered the university not to release records on Holmes.

The news organizations include The Denver Post, three other newspapers, four Denver television stations, six broadcast networks and two newspaper groups.

A spokeswoman for the district attorney's office declined to comment. Holmes' attorneys didn't immediately return a call.

Meanwhile, authorities also are investigating whether Holmes practiced shooting in the remote mountains northwest of Denver.

The owner of C&M Guns in the town of Hot Sulphur Springs said local authorities, as well as agents with the FBI and the Bureau of Alcohol, Tobacco, Firearms and Explosives, have asked him whether Holmes came into his shop, which is near a public shooting range. Clark Branstetter said he didn't remember seeing Holmes.

KUSA-TV in Denver first reported the visit to that shop and another unnamed one in the area.

The public shooting range is owned by the Colorado Division of Wildlife. A spokesman wouldn't comment on whether Holmes used the range. The range isn't staffed and no records are kept of who uses it.

In late June, Holmes tried to join a private gun range east of Aurora but he never showed up.

___

Associated Press writers Dan Elliott and Steven K. Paulson in Denver and researcher Barbara Sambriski in New York contributed to this report.