javascript and layout update