More About Points »
An over charging alternator is a problem. However with the ignition "on" only , that is engine off but key on , you would be on battery power. The windows etc should work normally. If not the alternator is not part of your problem(s).
The process is easy though obscure. Best to get a manual , online or in print form. Try here http://www.bentleypublishers.com/vw/new-beetle/1998-2009/VW-New-Beetle-Service-Manual-98-08.html
Given the year and model you may have a failing fuel pump. Assuming this is a Gas engine. I would still try positively diagnosing it i.e. monitor fuel pressure with a gauge at idle first. The electrical portion of the ignition switch is a possibility as well. Spend a minute with a scan tool if you can......
Is this a Diesel or Gas engine? You should check for fault codes and confirm fuel trim with a scan tool first of all........
It is the Fan Control Module. I believe it is designated J93 in the wiring diagram.
This car has very basic self diagnostic features. You put a fuse in the open slot on the fuel pump relay to initiate a flash code sequence , like morse code. The results may indicate where to start looking. A basic tutorial is here http://www.google.com/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fwww.autolib.diakom.ru%2FCARS2%2Fpribor%2Fcs1000%2Fmanual%2Fvw_blink.pdf&ei=uaAMSpSRL42Ntgf7-bmBCA&usg=AFQjCNEoaOQyQ-T_K5xG5O7FGZwjzYnoLg&sig2=RkeGRJq6kJbq5f0rDYy8vw As far as where the crank sensor is , follow the wires from the grey connector on the firewall , drivers side. If it won't restart hot you may have residual fuel pressure issues.
Start by checking the fuses. I believe fuse 7 row B and fuse 3 row C , are involved. There is a diagram inside the access hatch of your fuse box cover. Does everything else work ?
You really need to retrieve the diagnostic information associated with the check engine light being on. This car uses generic OBD II so you can use a scanner as supplied by most FLAPS (friendly large auto part stores) , such as Kragen , Auto/Zone etc. Some provide this service free. Short of that check for loose/broken hoses , poor wiring connections at the engine and so on. There are several known issues with these cars , so get the fault code(s) retrieved first.......
A search here http://www-odi.nhtsa.dot.gov/tsbs/ reveals this http://www-odi.nhtsa.dot.gov/cars/problems/tsb/tsbsummary.cfm?tsbs_id=625715&type=VEHICLE&searchtype=QuickSearch
P0340 is "Camshaft Position Sensor "A" Circuit (Bank 1 or single sensor)"