First of all the Search feature is your friend. In fact, this subject is being discussed just a few threads down from this one ... and it has been discussed many times in the past.
Second, drink more. The leading cause of cramps is dehydration. The next most common cause of cramps is lack of adequate electrolytes. The most common electrolytes are sodium and potassium, but there are several minerals which fall under the electrolyte category.