break embedded JavaScript into a nice, modular js file in the Graphical Elements mold