Click through the links here (Symptoms, Causes, etc) for everything that doctors know (and, equally, don't know) about leg cramps:
http://www.nhs.uk/con...ges/Introduction.aspx
However one possible cause is insufficient salt in your diet. (While 'experts' are always telling us to reduce our salt intake it's often forgotten than a certain amount of sodium is essential for our well-being. Many over-the-counter medications, for dealing with cramp, actually contain little more than common salt).
Chris