Stability of systems with periodic nonlinearities: a method of periodic Lyapunov functionals