Time-dependent Karhunen-Loeve type decomposition methods for SPDEs