Javascript and updated layout