Javascript for sign in and cancel buttons