My own style is to put related functions into an object, which I put into its own .js file. This way, I always know which file to look in when I want to find some code. (I also use OOD/OOP encapsulation to put everything is in that one global variable so I can easily mix scripts.) If I did that here, for instance, the Cookie object would be in Cookie.js, which would have its own script tag. I'd also probably make a Screen.js that would include tilesets, rendering, scrolling, etc., and Chat.js for handling the chat window. I might look into something like that to better organize code relations, which I find makes editing easier.
-QuaCzar : SysOp | P2P Guide | Anarchy Leader | #1 Magic