The Rule!
If the word after starts with a 'medeklinker' (consonant): use A
If the word after sounds like it starts with a medeklinker,: use A
If the word after starts with a klinker (vowel); use AN
If the word after sounds like it starts with a klinker: use AN