In one of the most inappropriate moves in memory ... Lindsay Lohan's new lawyer tried to get the judge in her criminal case to read a letter in which he claims he and the prosecutor are working as a team to "fix" Lindsay.
TMZ broke the story ... attorney Mark Heller attached a letter he wrote to the Santa Monica and L.A. City Attorneys to legal docs he filed with the court. Sources connected with the prosecution tell us the letter pissed the judge off because it looks like an attempt to improperly influence the court.
In the letter, Heller writes to prosecutors Terry White and Spencer Hart ... "... we, as a team, [can] help 'fix' Lindsay Lohan."
Heller goes on to blame Lindsay's troubles on her dysfunctional family, claiming you can't judge her "without considering the pain, torment and confusion which Lindsay has experienced and has been afflicted with."
Heller tries to steer the prosecutor -- and realistically the judge as well -- away from jail time, saying, "Lindsay will gladly be participating in intensive psychotherapy, submitting herself to regular screenings and contributing her time to the production of public service messages." He also offers up Lindsay to speak at schools, hospitals and other venues "where she may provide inspirational talks."
And get this ... Heller says he's exploring the creation of a Lindsay Lohan foundation that will provide a non-profit program to benefit young people.