style popup + error fix

error: onpopupclose, lastPopup wasn't set to false