Changes to the login cycle

Decoupled javascript by added custom.js