/*! Socket.IO.js build:0.9.0, development. Copyright(c) 2011 LearnBoost MIT Licensed */ (function(n,t){var i=n;i.version="0.9.0",i.protocol=1,i.transports=[],i.j=[],i.sockets={},i.connect=function(n,r){var u=i.util.parseUri(n),o,f,e;return t&&t.location&&(u.protocol=u.protocol||t.location.protocol.slice(0,-1),u.host=u.host||(t.document?t.document.domain:t.location.hostname),u.port=u.port||t.location.port),o=i.util.uniqueUri(u),e={host:u.host,secure:"https"==u.protocol,port:u.port||("https"==u.protocol?443:80),query:u.query||""},i.util.merge(e,r),(e["force new connection"]||!i.sockets[o])&&(f=new i.Socket(e)),!e["force new connection"]&&f&&(i.sockets[o]=f),f=f||i.sockets[o],f.of(u.path.length>1?u.path:"")}})("object"==typeof module?module.exports:this.io={},this),(function(n,t){var i=n.util={},f=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,u=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],r;i.parseUri=function(n){var r=f.exec(n||""),i={},t=14;while(t--)i[u[t]]=r[t]||"";return i},i.uniqueUri=function(n){var u=n.protocol,i=n.host,r=n.port;return"document"in t?(i=i||document.domain,r=r||(u=="https"&&document.location.protocol!=="https:"?443:document.location.port)):(i=i||"localhost",r||u!="https"||(r=443)),(u||"http")+"://"+i+":"+(r||80)},i.query=function(n,t){var u=i.chunkQuery(n||""),f=[],r;i.merge(u,i.chunkQuery(t||""));for(r in u)u.hasOwnProperty(r)&&f.push(r+"="+u[r]);return f.length?"?"+f.join("&"):""},i.chunkQuery=function(n){for(var u={},r=n.split("&"),i=0,f=r.length,t;it.length?n:t,u=n.length>t.length?t:n,r=0,e=u.length;r0&&n.splice(0,1)[0]!=i.transport.name);n.length?o(n):i.publish("connect_failed")}}},i.options["connect timeout"]))})}i.sessionid=r,i.closeTimeout=f*1e3,i.heartbeatTimeout=u*1e3,i.transports=t.util.intersect(e.split(","),i.options.transports),o();i.once("connect",function(){clearTimeout(i.connectTimeoutTimer),n&&typeof n=="function"&&n()})}),this},r.prototype.packet=function(n){return this.connected&&!this.doBuffer?this.transport.packet(n):this.buffer.push(n),this},r.prototype.setBuffer=function(n){this.doBuffer=n,!n&&this.connected&&this.buffer.length&&(this.transport.payload(this.buffer),this.buffer=[])},r.prototype.disconnect=function(){if(this.connected){this.open&&this.of("").packet({type:"disconnect"});this.onDisconnect("booted")}return this},r.prototype.disconnectSync=function(){var i=t.util.request(),n=this.resource+"/"+t.protocol+"/"+this.sessionid;i.open("GET",n,!0);this.onDisconnect("booted")},r.prototype.isXDomain=function(){var n=i.location.port||("https:"==i.location.protocol?443:80);return this.options.host!==i.location.hostname||this.options.port!=n},r.prototype.onConnect=function(){this.connected||(this.connected=!0,this.connecting=!1,this.doBuffer||this.setBuffer(!1),this.emit("connect"))},r.prototype.onOpen=function(){this.open=!0},r.prototype.onClose=function(){this.open=!1},r.prototype.onPacket=function(n){this.of(n.endpoint).onPacket(n)},r.prototype.onError=function(n){n&&n.advice&&this.options.reconnect&&n.advice==="reconnect"&&this.connected&&(this.disconnect(),this.reconnect()),this.publish("error",n&&n.reason?n.reason:n)},r.prototype.onDisconnect=function(n){var t=this.connected;this.connected=!1,this.connecting=!1,this.open=!1,t&&(this.transport.close(),this.transport.clearTimeouts(),this.publish("disconnect",n),"booted"!=n&&this.options.reconnect&&!this.reconnecting&&this.reconnect())},r.prototype.reconnect=function(){function i(){if(n.connected){for(var i in n.namespaces)n.namespaces.hasOwnProperty(i)&&""!==i&&n.namespaces[i].packet({type:"connect"});n.publish("reconnect",n.transport.name,n.reconnectionAttempts)}clearTimeout(n.reconnectionTimer),n.removeListener("connect_failed",t),n.removeListener("connect",t),n.reconnecting=!1,delete n.reconnectionAttempts,delete n.reconnectionDelay,delete n.reconnectionTimer,delete n.redoTransports,n.options["try multiple transports"]=r}function t(){if(!n.reconnecting)return;if(n.connected)return i();if(n.connecting&&n.reconnecting)return n.reconnectionTimer=setTimeout(t,1e3);if(n.reconnectionAttempts++=10},i.xdomainCheck=function(){return!0},typeof window!="undefined"&&(WEB_SOCKET_DISABLE_AUTO_INITIALIZATION=!0),t.transports.push("flashsocket")})("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports);if("undefined"!=typeof window)var swfobject=function(){function v(){var i,r,n;if(c)return;try{i=t.getElementsByTagName("body")[0].appendChild(s("span")),i.parentNode.removeChild(i)}catch(u){return}for(c=!0,r=b.length,n=0;n0)for(r=0;r0){t=u(o);if(t)if(!g(h[r].swfVersion)||n.wk&&n.wk<312)if(h[r].expressInstall&&tt()){e={},e.data=h[r].expressInstall,e.width=t.getAttribute("width")||"0",e.height=t.getAttribute("height")||"0",t.getAttribute("class")&&(e.styleclass=t.getAttribute("class")),t.getAttribute("align")&&(e.align=t.getAttribute("align"));var p={},a=t.getElementsByTagName("param"),w=a.length;for(c=0;c');w.outerHTML='"+b+"",k[k.length]=t.id,v=u(t.id)}else{c=s(f),c.setAttribute("type",p);for(h in t)t[h]!=Object.prototype[h]&&(h.toLowerCase()=="styleclass"?c.setAttribute("class",t[h]):h.toLowerCase()!="classid"&&c.setAttribute(h,t[h]));for(l in r)r[l]!=Object.prototype[l]&&l.toLowerCase()!="movie"&&ri(c,l,r[l]);w.parentNode.replaceChild(c,w),v=c}}return v}function ri(n,t,i){var r=s("param");r.setAttribute("name",t),r.setAttribute("value",i),n.appendChild(r)}function ht(t){var i=u(t);i&&i.nodeName=="OBJECT"&&(n.ie&&n.win?(i.style.display="none",(function(){i.readyState==4?ii(t):setTimeout(arguments.callee,10)})()):i.parentNode.removeChild(i))}function ii(n){var t=u(n),i;if(t){for(i in t)typeof t[i]=="function"&&(t[i]=null);t.parentNode.removeChild(t)}}function u(n){var i=null;try{i=t.getElementById(n)}catch(r){}return i}function s(n){return t.createElement(n)}function dt(n,t,i){n.attachEvent(t,i),a[a.length]=[n,t,i]}function g(t){var r=n.pv,i=t.split(".");return i[0]=parseInt(i[0],10),i[1]=parseInt(i[1],10)||0,i[2]=parseInt(i[2],10)||0,r[0]>i[0]||r[0]==i[0]&&r[1]>i[1]||r[0]==i[0]&&r[1]==i[1]&&r[2]>=i[2]?!0:!1}function wt(r,u,o,h){var a,l,c;if(n.ie&&n.mac)return;a=t.getElementsByTagName("head")[0];if(!a)return;l=o&&typeof o=="string"?o:"screen",h&&(e=null,ot=null),e&&ot==l||(c=s("style"),c.setAttribute("type","text/css"),c.setAttribute("media",l),e=a.appendChild(c),n.ie&&n.win&&typeof t.styleSheets!=i&&t.styleSheets.length>0&&(e=t.styleSheets[t.styleSheets.length-1]),ot=l),n.ie&&n.win?e&&typeof e.addRule==f&&e.addRule(r,u):e&&typeof t.createTextNode!=i&&e.appendChild(t.createTextNode(r+" {"+u+"}"))}function l(n,t){if(!bt)return;var i=t?"visible":"hidden";c&&u(n)?u(n).style.visibility=i:wt("#"+n,"visibility:"+i)}function st(n){var r=/[\\\"<>\.;]/,t=r.exec(n)!=null;return t&&typeof encodeURIComponent!=i?encodeURIComponent(n):n}var i="undefined",f="object",at="Shockwave Flash",ti="ShockwaveFlash.ShockwaveFlash",p="application/x-shockwave-flash",lt="SWFObjectExprInst",yt="onreadystatechange",r=window,t=document,o=navigator,vt=!1,b=[ni],h=[],k=[],a=[],y,d,ut,ct,c=!1,w=!1,e,ot,bt=!0,n=function(){var a=typeof t.getElementById!=i&&typeof t.getElementsByTagName!=i&&typeof t.createElement!=i,s=o.userAgent.toLowerCase(),e=o.platform.toLowerCase(),l=e?/win/.test(e):/win/.test(s),y=e?/mac/.test(e):/mac/.test(s),v=/webkit/.test(s)?parseFloat(s.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,h=!1,u=[0,0,0],n=null,c;if(typeof o.plugins!=i&&typeof o.plugins[at]==f)n=o.plugins[at].description,!n||typeof o.mimeTypes!=i&&o.mimeTypes[p]&&!o.mimeTypes[p].enabledPlugin||(vt=!0,h=!1,n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),u[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10),u[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10),u[2]=/[a-zA-Z]/.test(n)?parseInt(n.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof r.ActiveXObject!=i)try{c=new ActiveXObject(ti),c&&(n=c.GetVariable("$version"),n&&(h=!0,n=n.split(" ")[1].split(","),u=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]))}catch(w){}return{w3:a,pv:u,wk:v,ie:h,win:l,mac:y}}(),ei=function(){if(!n.w3)return;(typeof t.readyState!=i&&t.readyState=="complete"||typeof t.readyState==i&&(t.getElementsByTagName("body")[0]||t.body))&&v(),c||(typeof t.addEventListener!=i&&t.addEventListener("DOMContentLoaded",v,!1),n.ie&&n.win&&(t.attachEvent(yt,function(){t.readyState=="complete"&&(t.detachEvent(yt,arguments.callee),v())}),r==top&&(function(){if(c)return;try{t.documentElement.doScroll("left")}catch(n){setTimeout(arguments.callee,0);return}v()})()),n.wk&&(function(){if(c)return;if(!/loaded|complete/.test(t.readyState)){setTimeout(arguments.callee,0);return}v()})(),pt(v))}(),fi=function(){n.ie&&n.win&&window.attachEvent("onunload",function(){for(var e=a.length,u,i,r,f,t=0;t= 10.0.0 is required.");return}location.protocol=="file:"&&n.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://..."),WebSocket=function(n,t,i,r,u){var f=this;f.__id=WebSocket.__nextId++,WebSocket.__instances[f.__id]=f,f.readyState=WebSocket.CONNECTING,f.bufferedAmount=0,f.__events={},t?typeof t=="string"&&(t=[t]):t=[],setTimeout(function(){WebSocket.__addTask(function(){WebSocket.__flash.create(f.__id,n,t,i||null,r||0,u||null)})},0)},WebSocket.prototype.send=function(n){if(this.readyState==WebSocket.CONNECTING)throw"INVALID_STATE_ERR: Web Socket connection has not been established";var t=WebSocket.__flash.send(this.__id,encodeURIComponent(n));return t<0?!0:(this.bufferedAmount+=t,!1)},WebSocket.prototype.close=function(){if(this.readyState==WebSocket.CLOSED||this.readyState==WebSocket.CLOSING)return;this.readyState=WebSocket.CLOSING,WebSocket.__flash.close(this.__id)},WebSocket.prototype.addEventListener=function(n,t){n in this.__events||(this.__events[n]=[]),this.__events[n].push(t)},WebSocket.prototype.removeEventListener=function(n,t){var u,r;if(!(n in this.__events))return;for(u=this.__events[n],r=u.length-1;r>=0;--r)if(u[r]===t){u.splice(r,1);break}},WebSocket.prototype.dispatchEvent=function(n){for(var r=this.__events[n.type]||[],i,t=0;t"),this.doc.close(),this.doc.parentWindow.s=this,n=this.doc.createElement("div"),n.className="socketio",this.doc.body.appendChild(n),this.iframe=this.doc.createElement("iframe"),n.appendChild(this.iframe),r=this,i=t.util.query(this.socket.options.query,"t="+ +new Date),this.iframe.src=this.prepareUrl()+i;t.util.on(window,"unload",function(){r.destroy()})},i.prototype._=function(n,t){this.onData(n);try{var i=t.getElementsByTagName("script")[0];i.parentNode.removeChild(i)}catch(r){}},i.prototype.destroy=function(){if(this.iframe){try{this.iframe.src="about:blank"}catch(n){}this.doc=null,this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,CollectGarbage()}},i.prototype.close=function(){return this.destroy(),t.Transport.XHR.prototype.close.call(this)},i.check=function(){if(typeof window!="undefined"&&"ActiveXObject"in window)try{var n=new ActiveXObject("htmlfile");return n&&t.Transport.XHR.check()}catch(i){}return!1},i.xdomainCheck=function(){return!1},t.transports.push("htmlfile")})("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),(function(n,t,i){function r(){t.Transport.XHR.apply(this,arguments)}function u(){}n["xhr-polling"]=r,t.util.inherit(r,t.Transport.XHR),t.util.merge(r,t.Transport.XHR),r.prototype.name="xhr-polling",r.prototype.open=function(){var n=this;return t.Transport.XHR.prototype.open.call(n),!1},r.prototype.get=function(){function f(){if(this.readyState==4){this.onreadystatechange=u;if(this.status==200){n.onData(this.responseText);n.get()}else n.onClose()}}function r(){this.onload=u,this.onerror=u;n.onData(this.responseText);n.get()}function t(){n.onClose()}if(!this.open)return;var n=this;this.xhr=this.request(),i.XDomainRequest&&this.xhr instanceof XDomainRequest?(this.xhr.onload=r,this.xhr.onerror=t):this.xhr.onreadystatechange=f,this.xhr.send(null)},r.prototype.onClose=function(){t.Transport.XHR.prototype.onClose.call(this);if(this.xhr){this.xhr.onreadystatechange=this.xhr.onload=this.xhr.onerror=u;try{this.xhr.abort()}catch(n){}this.xhr=null}},r.prototype.ready=function(n,i){var r=this;t.util.defer(function(){i.call(r)})},t.transports.push("xhr-polling")})("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),(function(n,t,i){function r(){t.Transport["xhr-polling"].apply(this,arguments),this.index=t.j.length;var i=this;t.j.push(function(n){i._(n)})}var u=i.document&&"MozAppearance"in i.document.documentElement.style;n["jsonp-polling"]=r,t.util.inherit(r,t.Transport["xhr-polling"]),r.prototype.name="jsonp-polling",r.prototype.post=function(n){function o(){e(),r.socket.setBuffer(!1)}function e(){r.iframe&&r.form.removeChild(r.iframe);try{u=document.createElement('