Created ScriptUtil for use in JavaScript files, as well as changing some old JavaScript code to Java code