[bug980162] - Moved inline script into separate js file

-> https://bugzilla.mozilla.org/show_bug.cgi?id=980162