Goal changes designed to garner votes are inevitable in a presidential campaign. You can't avoid them. They're like pollution -- there will always be at least a little of it around. Both candidates have moved to the right, which puts Obama closer to the center and McCain closer to the conservative end of the spectrum.
That's all pretty normal. McCain's problem is that he's been clumsier at it, his switches more blatant and obvious, due probably to the inefficiency of his recently replaced campaign manager. McCain may get farther if his new manager is able to formulate a simple-minded message with a good bumper-sticker slogan and then stick to it, hammering it in over and over again to get the attention of all those "low -information voters" out there.
Obama has shifted too, and some of his critics are now on the left. They're the people who can afford to be ideological purists because they're not running for office. The media too has been doing its best to twist Obama's recent statements about troop withdrawal into a "flip flop," an expression that should be expunged from the political vocabulary and restricted to footgear. Obama has always said that he would withdraw the troops. Now he's trying to specify exactly how he would do it and spell out what contingencies need to be taken into account. Do we really want a leader who would do it otherwise?