refactor javascript to its own file, add a NoScaled version.