Folding transformations of the Painlevé equations