Split the javascript to separate file, added support for URL variable message