js containers imroved, popup width is calculated dynamically