Moved AMS javascript to ams.js