small js fixes for popups