move code from footer.js into admin.js