Move javascript to external file