  We study the low-temperature behavior and the phase transition of a thin film
by Monte Carlo simulation. The thin film has a simple cubic lattice structure
where each site is occupied by a Potts parameter which indicates the molecular
orientation of the site. We take only three molecular orientations in this
paper which correspond to the 3-state Potts model. The Hamiltonian of the
system includes: (i) the exchange interaction $J_{ij}$ between nearest-neighbor
sites $i$ and $j$ (ii) the long-range dipolar interaction of amplitude $D$
truncated at a cutoff distance $r_c$ (iii) a single-ion perpendicular
anisotropy of amplitude $A$. We allow $J_{ij} =J_s$ between surface spins, and
$J_{ij}=J$ otherwise. We show that the ground state depends on the the ratio
$D/A$ and $r_c$. For a single layer, for a given $A$, there is a critical value
$D_c$ below (above) which the ground-state (GS) configuration of molecular axes
is perpendicular (parallel) to the film surface. When the temperature $T$ is
increased, a re-orientation transition occurs near $D_c$: the low-$T$ in-plane
ordering undergoes a transition to the perpendicular ordering at a finite $T$,
below the transition to the paramagnetic phase. The same phenomenon is observed
in the case of a film with a thickness. We show that the surface phase
transition can occur below or above the bulk transition depending on the ratio
$J_s/J$. Surface and bulk order parameters as well as other physical quantities
are shown and discussed.

Statistical Mechanics