cleaned up the javascript within index.html and put it in facebook.js