Universal battery charger circuit