  We present the results of the observations of the (J,K)=(1,1) and the
(J,K)=(2,2) inversion transitions of the NH3 molecule toward a large sample of
40 regions with molecular or optical outflows, using the 37 m radio telescope
of the Haystack Observatory. We detected NH3 emission in 27 of the observed
regions, which we mapped in 25 of them. Additionally, we searched for the
6{16}-5{23} H2O maser line toward six regions, detecting H2O maser emission in
two of them, HH265 and AFGL 5173. We estimate the physical parameters of the
regions mapped in NH3 and analyze for each particular region the distribution
of high density gas and its relationship with the presence of young stellar
objects. From the global analysis of our data we find that in general the
highest values of the line width are obtained for the regions with the highest
values of mass and kinetic temperature. We also found a correlation between the
nonthermal line width and the bolometric luminosity of the sources, and between
the mass of the core and the bolometric luminosity. We confirm with a larger
sample of regions the conclusion of Anglada et al. (1997) that the NH3 line
emission is more intense toward molecular outflow sources than toward sources
with optical outflow, suggesting a possible evolutionary scheme in which young
stellar objects associated with molecular outflows progressively lose their
neighboring high-density gas, weakening both the NH3 emission and the molecular
outflow in the process, and making optical jets more easily detectable as the
total amount of gas decreases.
