  An effective free energy of a two dimensional (i.e. large area) Josephson
Junctions is derived, allowing for thermal fluctuations, for random magnetic
fields and for external currents. We show by using replica symmetry breaking
methods, that the junction has four distinct phases: disordered, Josephson
ordered, a glass phase and a coexisting Josephson order with the glass phase.
Near the coexistence to glass transition at s=1/2 the critical current is ~
(area)^{-s+1/2} where s is a measure of disorder. Our results may account for
junction ordering at temperatures well below the critical temperature of the
bulk in high T_c trilayer junctions.
