#711 moved js code to new.js