The answer given in the above post is misleading.
Gravity doesn't come from centripetal force. In fact, the reverse is true. The gravitational pull of the earth provides centripetal forces to objects resting on earth surface.
"Force" is not equal to "energy". Gravity doesn't come from the "internal energy" of the earth. Instead, it comes from the "mass" of the earth.
The origin of gravity can be explained by Einstein's General Theory of Relativity, which he published in 1915. Simply speaking, any mass would make the space (and also time) around it to curve. This is called warpping of space. Since any straight line trajectory on a flat surface appears curved on a warpped space, thus an object travelling close to another larger (massive) object would appear to curve towards the larger object on the wrapped space. The is observed by us as gravitational attraction.
You may refer to the following web-page for details:
http://abyss.uoregon.edu/~js/21st_century_science/lectures/lec07.html
http://physics.suite101.com/article.cfm/gravity_and_general_relativity
The following youtube movie (~7 min) also shows a good illustration of Einstein's General Relativity and Gravitation. Pay particular attention to the last 2 minutes of the movie in which wrapping of space is introduced.
http://www.youtube.com/watch?v=tpbGuuGosAY