move js from main script to admin page