js for link switching for login/logout