moved some generated JS code to static file