Move javascript to external file. Fix for [#8]