It's usually the alternator that's out. I'd say that maybe a ground on the alt or a power wire is loose and it's connection is coming and going. I'd take it out of the car and bring it in to any auto parts store to have it tested, it's free and only takes a few minutes to test.
Who knows, during the removal/installation of it you may see your problem.