An excellent additional source about magnetism can be found here.
Some History
The ancient Greeks, originally those near the city of Magnesia, and also the early Chinese knew about strange and rare stones (possibly chunks of iron ore struck by lightning) with the power to attract iron. A steel needle stroked with such a "lodestone" became "magnetic" as well, and around 1000 the Chinese found that such a needle, when freely suspended, pointed north-south.
The magnetic compass soon spread to Europe. Columbus used it when he crossed the Atlantic ocean, noting not only that the needle deviated slightly from exact north (as indicated by the stars) but also that the deviation changed during the voyage. Around 1600 William Gilbert, physician to Queen Elizabeth I of England, proposed an explanation: the Earth itself was a giant magnet, with its magnetic poles some distance away from its geographic ones (i.e. near the points defining the axis around which the Earth turns).
Until 1821, only one kind of magnetism was known, the one produced by iron magnets. Then a Danish scientist, Hans Christian Oersted, while demonstrating to friends the flow of an electric current in a wire, noticed that the current caused a nearby compass needle to move. The new phenomenon was studied in France by Andre-Marie Ampere, who concluded that the nature of magnetism was quite different from what everyone had believed. It was basically a force between electric currents: two parallel currents in the same direction attract, in oposite directions repel. Iron magnets are a very special case, which Ampere was also able to explain.
http://www-spof.gsfc.nasa.gov/Education/Imagnet.html
What Causes Magnetism?
Magnetism and current electricity are closely linked. The link is the movement of charges. Magnetic fields are created by the movement of charges.
magnetic materials
All matter contains charged particles that are moving, but this motion, from atom to atom, is usually totally random. In some materials, the atoms have a more orderly arrangement, and the charges they contain move in such a way that the magnetic fields they produce combine instead of cancel out. These materials are known as ferromagnetic materials, and include iron, cobalt, nickel and neodymium.
As you know, not all pieces of iron are magnets. But all iron has the ability to become magnetized. Within an ordiary piece of iron, there are groups of atoms that are synchronized. Each tiny group, called a magnetic domain, behaves as a tiny magnet. But in ordinary iron, these groups are randomly oriented.
un-magnetized iron.
To make the iron into a magnet, these domains must be aligned. This can be accomplished by bring the iron near a permanent magnet or putting it in some other magnetic field. Sometimes it can even be accomplished by banging on the metal. The result is an orderly arrangement of the domains and a piece of iron that is now a magnet.
magnetized iron.
Heating the magnet may cause the domains to scramble and could result in the magnet losing its magnetism and becoming just a normal metal again.
Conventions and Definitions
All magnets have two poles, labeled north and south.
The curved lines with arrows shown in the diagram represent the magnetic field of the magnet. The magnetic field is the region in space around the magnet where a magnetic force could exist. By convention, the arrows point in the direction that a compass needle would point if placed in the magnetic field. The lines of magnetic field from a bar magnet form closed lines. Again, by convention, the field direction is taken to be outward from the North pole and into the South pole of the magnet.
Click here to open an animation that allows you to explore the shape of a magnetic field.
http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/elemag.html#c1
opposites attract
Just like electric charges, magnetic forces can be attractive or repulsive.
measuring magnetism
The strength of a magnet is defined by the strength of the magnetic field it produces. A magnetic field, B, is measured in units called the Tesla, T. In simpler SI units the Tesla can be described as a combination of Newtons, seconds, Coulombs and meters.
Earth's Magnetic and Geographic Poles
The earth spins around an imaginary line called its axis. Where this line extends out from the top and bottom of our planet we find the geographic north and south poles.
The earth's magnetic poles are not in the same locations as its geographic poles. The core of the earth is made of iron, giving our planet its magnetic propeties. The outer core is molten and the iron flows, changing the position of the magnetic poles.
If we visualize the earth as a giant bar magnet, you can see the location of the geographic and magnetic poles.
the compass
A compass is actually a small magnet on a swivel. The north pole of you compass points generally towards the north geographic pole of the earth. In reality, it is poining towards the magnetic south pole of the giant magnet that is the Earth. To make this even more confusing, we call this direction magnetic north (instead of true north).
Example 1 - Pole Position
Example 2 - Am I Lost?
The Earth's magnetic field plays an important role for out planet. It protects us from the harmful cosmic rays that arrive from our Sun. These rays are deflected away from our planet by the magnetic field prottecting us and every other living thing from the harm the sun's rays would cause.
The aurora borealis or northern lights, is a spectacular display of this cosmic radiation being deflected. These displays are visible in the exterme northern hemispshere, particularly after strong solar flares.