js code for admin event