Wrote a bunch of javascript functions for admin