move login window functions into a separate JS file and add debug statements