Critical currents and thermally activated flux motion in high-temperature superconductors