log in page bug fix

when click the login link in the product page , maybe the page will be
opened in a new window. so need to switch to the window before login.