Cosmological Simulation Studies of the Intrinsic Alignment of Galaxies