The battery is used to start the engine. The engine runs the AC compressor, the alternator and makes heat for the heater.
The alternator recharges the battery and powers the electrical devices.
You may like this system being put in around the country at truck stops.
http://www.idleaire.com/