* these are nitpicky things that some browsers just step right over silently, and others halt script execution for
* the jquery trim function only works on variables that have been returned as jquery objects, so doing "'foo'.trim()" doesn't work, should be "$.trim('foo')"
* some javascript interpreters (annoyingly) can't handle trailing commas in lists
* repro: open webui-aria2 in any browser that doesn't have native websocket support in its javascript library (example: Opera 12.01, IE9), and none of the functionality in webui-aria2 will work due to javascript errors
* see: http://en.wikipedia.org/wiki/WebSocket#Browser_support (Note that Firefox has websocket support, but calls its object "MozWebSocket" instead of "WebSocket", so this issue applies there too)
* there were a few places in script.js that check for websocket support by doing something like "if(WebSocket)" to see if the WebSocket object exists
* javascript doesn't handle undefined variables that way, the interpreter will actually throw an "undefined variable" error and stop execution of the script
* this means that any browser that doesn't have websocket support can never reach the fallback json call code
* added a new variable "web_sock_support" that does a proper "undefined" check, and is set to "1" if the "WebSocket" object is available in the browser
* changed the websocket checks to use the "web_sock_support" variable