Updated JS that appears to work. Previous version got borked after the l...

Updated JS that appears to work. Previous version got borked after the login screen changed.