Permanent Magnet- Magnetic Field.
http://www.diracdelta.co.uk/science/source/m/a/magnetic%20field/source.html
Magnets have two poles called North and South.
Similar (like) magnetic poles repel. Unlike magnetic poles attract. A magnet attracts a piece of iron. The most important of the two properties of attraction and repulsion is repulsion. The only way to tell if an object is magnetised is to see if it repels another magnetised object.
The strength and direction of a magnetic field is represented by magnetic field lines. Field lines by convention go from North to South. A magnetic field is three-dimensional, although this is not often seen on a drawing of magnetic field lines.
Electromagnets
A magnetic field exists around all wires carrying a current.
When there is no current the compass needles in the diagram shown line up with the Earth's magnetic field. A current through the wire produces a circular magnetic field. See what happens when there is a current in the wire.
The magnetic field for a coil of wire is shown below. The magnetic fields from each of the turns in the coil add together, so the total magnetic field is much stronger. This produces a field which is similar to that of a bar magnet. A coil of wire like this is often called a solenoid.
http://www.bbc.co.uk/bitesize/standard/physics/using_electricity/movement_from_electricity/revision/1/slideshow-1/2/
An electromagnet consists of a coil of wine, through which a current can be passed, wrapped around a soft iron core. This core of magnetic material increases the strength of the field due to the coil. ‘Soft’ iron is easily magnetised, and easy to demagnetise- it does not retain its magnetism after the current is switched off. Steel, on the other hand, is hard to magnetise and demagnetise, and so it retains in magnetism. It is used for permanent magnets.
The strength of an electromagnet depends on:
The size of the current flowing through the coil
The number of turns