I found this website very informative in deciding which kind of magnesium supplement to buy, and how much is safe to take: http://www.afibbers.org/magnesium.htm
Near the end, the author also gives a list of the different forms magnesium can take and compares which are better absorbed (and how much magnesium is absorbed per 500mg tablet).