merge login.js with popup-nav.js