Hey, unless you've got a manual (gregory's or similar) the easiest way i have found is using elimation. Normally its pretty easy to work out which ones are for the speakers so if you get down to having three left there will be a black one which is normally ground (i say normally, some car manufacturers like to be pains and change the colour of world standard. go figure?) Neway that normally leaves you with two wires. one will be straight from the batt, and the other will be run though ignition. from your head unit connect the ignition and memory(batt) lead together. then with your unit plugged in and the ground connected, also connect your antanna (some use this as a ground as well) with the ignition off touch the wire (12v and ign) from your head unit to one of the wires and try and turn your unit on. if it comes on, you know that it is the batt lead. if nothing happens turn your acc. on and try switching the unit on. if it works this way you know that it is the ignition lead.
Its kinda hard to explain but hope it helps
Let me know how you go.