/*
Copyright: Hiroshi Ichikawa
License: New BSD License
Reference: http://dev.w3.org/html5/websockets/
Reference: http://tools.ietf.org/html/rfc6455
*/
/* Version 1.5.0.9 */
'use strict';(function(){var c;c=window.WEB_SOCKET_LOGGER?window.WEB_SOCKET_LOGGER:window.console&&window.console.log&&window.console.error?window.console:{log:function(){},error:function(){}};11>swfobject.getFlashPlayerVersion().major?c.error("Flash Player >= 11.1.0 is required."):("file:"==location.protocol&&c.error("WARNING: web-socket-js doesn't work in file:///... URL unless you set Flash Security Settings properly. Open the page via Web server i.e. http://..."),window.FlashWebSocket=function(a,
b,e,c,f){var d=this;d.d=FlashWebSocket.p++;FlashWebSocket.k[d.d]=d;d.readyState=FlashWebSocket.CONNECTING;d.bufferedAmount=0;d.b={};b?"string"==typeof b&&(b=[b]):b=[];d.c=setTimeout(function(){FlashWebSocket.h(function(){d.c=null;FlashWebSocket.a.create(d.d,a,b,e||null,c||0,f||null)})},0)},FlashWebSocket.prototype.send=function(a){if(this.readyState==FlashWebSocket.CONNECTING)throw"INVALID_STATE_ERR: Web Socket connection has not been established";a=FlashWebSocket.a.send(this.d,encodeURIComponent(a));
if(0>a)return!0;this.bufferedAmount+=a;return!1},FlashWebSocket.prototype.close=function(){this.c?(clearTimeout(this.c),this.c=null,this.readyState=FlashWebSocket.CLOSED):this.readyState!=FlashWebSocket.CLOSED&&this.readyState!=FlashWebSocket.f&&(this.readyState=FlashWebSocket.f,FlashWebSocket.a.close(this.d))},FlashWebSocket.prototype.addEventListener=function(a,b){a in this.b||(this.b[a]=[]);this.b[a].push(b)},FlashWebSocket.prototype.removeEventListener=function(a,b){if(a in this.b)for(var e=this.b[a],
c=e.length-1;0<=c;--c)if(e[c]===b){e.splice(c,1);break}},FlashWebSocket.prototype.dispatchEvent=function(a){for(var b=this.b[a.type]||[],c=0;c