Beam maser investigation of inelastic scattering of NH3. I. Cross sections for inversion transitions induced by polar gases