This patch mostly fixes problems when minifying the code by making sure needed semicolons exist. It also removes a bunch of unnecessary semicolons and fixes possible problems with parseInt(). I also fixed a problem with the demo page on casesensitive filesystems (like Linux).
For fixing the code I tried to run the code through http://www.jshint.com/ using the following options:
/*jshint latedef:false, forin:true, eqeqeq:false, eqnull:true, noarg:true, noempty:true, bitwise:true, undef:true, browser:true, indent:4, maxerr:150, multistr:true, sub:true, smarttabs:true, white:false */
JSHint still find a whole bunch of problems mostly related to undefined variables. It seems like you're relying on several global variables (like settings for example). These should ideally be moved to become class members instead.
The patches should be pretty selfcontained, so feel free to cherrypick if you don't like certain things.
var statement was closed too early
missing semicolon on assignment
escape curly brackets
curly brackets have special meaning in regular expressions and should be
escaped when used as literal strings
added missing semicolons
give radix when using parseInt
for why that might be important
another missing semicolon
removed unecessary semicolons
Semicolons are only needed to terminate statements and assignments, they
are not needed for control structures or function bodies (except the
function is defined by assigning a closure, then it's an assignment
fixed image references
some image files used uppercase extensions (.JPG) which will not work on
file sensitive filesystems.
removed ad code