Characterization of glass and high-power near-infrared cw laser beams using nonlinear optical techniques