/*!
* Pusher JavaScript Library v1.3
* http://pusherapp.com/
*
* Copyright 2010, New Bamboo
* Released under the MIT licence.
*/
/*
* This library contains code with the following licences:
*
* web_socket.js:
*
* Copyright: Hiroshi Ichikawa
* License: New BSD License
* Reference: http://dev.w3.org/html5/websockets/
* Reference: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol
*
* swfobject.js:
*
* SWFObject v2.2
* is released under the MIT License
*
* FABridge.js:
*
* Copyright 2006 Adobe Systems Incorporated
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*/
if(!this.JSON)this.JSON={};
(function(){function a(i){return i<10?"0"+i:i}function c(i){g.lastIndex=0;return g.test(i)?'"'+i.replace(g,function(n){var t=w[n];return typeof t==="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'}function e(i,n){var t,z,D=m,y,o=n[i];if(o&&typeof o==="object"&&typeof o.toJSON==="function")o=o.toJSON(i);if(typeof x==="function")o=x.call(n,i,o);switch(typeof o){case "string":return c(o);case "number":return isFinite(o)?String(o):"null";case "boolean":case "null":return String(o);case "object":if(!o)return"null";
m+=s;y=[];if(Object.prototype.toString.apply(o)==="[object Array]"){z=o.length;for(i=0;i0)for(var d=0;d0){var p=o(f);if(p)if(R(H[d].swfVersion)&&!(k.wk&&k.wk<312)){L(f,true);if(h){j.success=true;j.ref=s(f);h(j)}}else if(H[d].expressInstall&&w()){j={};j.data=H[d].expressInstall;j.width=p.getAttribute("width")||"0";j.height=p.getAttribute("height")||"0";if(p.getAttribute("class"))j.styleclass=p.getAttribute("class");if(p.getAttribute("align"))j.align=p.getAttribute("align");var q={};p=p.getElementsByTagName("param");for(var v=p.length,B=0;B<
v;B++)if(p[B].getAttribute("name").toLowerCase()!="movie")q[p[B].getAttribute("name")]=p[B].getAttribute("value");x(j,q,f,h)}else{i(p);h&&h(j)}}else{L(f,true);if(h){if((f=s(f))&&typeof f.SetVariable!=u){j.success=true;j.ref=f}h(j)}}}}function s(b){var d=null;if((b=o(b))&&b.nodeName=="OBJECT")if(typeof b.SetVariable!=u)d=b;else if(b=b.getElementsByTagName(E)[0])d=b;return d}function w(){return!S&&R("6.0.65")&&(k.win||k.mac)&&!(k.wk&&k.wk<312)}function x(b,d,f,h){S=true;Y=h||null;aa={success:false,
id:f};var j=o(f);if(j){if(j.nodeName=="OBJECT"){N=n(j);T=null}else{N=j;T=f}b.id=ba;if(typeof b.width==u||!/%$/.test(b.width)&&parseInt(b.width,10)<310)b.width="310";if(typeof b.height==u||!/%$/.test(b.height)&&parseInt(b.height,10)<137)b.height="137";r.title=r.title.slice(0,47)+" - Flash Player Installation";h=k.ie&&k.win?"ActiveX":"PlugIn";h="MMredirectURL="+C.location.toString().replace(/&/g,"%26")+"&MMplayerType="+h+"&MMdoctitle="+r.title;if(typeof d.flashvars!=u)d.flashvars+="&"+h;else d.flashvars=
h;if(k.ie&&k.win&&j.readyState!=4){h=A("div");f+="SWFObjectNew";h.setAttribute("id",f);j.parentNode.insertBefore(h,j);j.style.display="none";(function(){j.readyState==4?j.parentNode.removeChild(j):setTimeout(arguments.callee,10)})()}t(b,d,f)}}function i(b){if(k.ie&&k.win&&b.readyState!=4){var d=A("div");b.parentNode.insertBefore(d,b);d.parentNode.replaceChild(n(b),d);b.style.display="none";(function(){b.readyState==4?b.parentNode.removeChild(b):setTimeout(arguments.callee,10)})()}else b.parentNode.replaceChild(n(b),
b)}function n(b){var d=A("div");if(k.win&&k.ie)d.innerHTML=b.innerHTML;else if(b=b.getElementsByTagName(E)[0])if(b=b.childNodes)for(var f=b.length,h=0;h';j.outerHTML='";U[U.length]=b.id;h=o(b.id)}else{v=A(E);v.setAttribute("type",Q);for(p in b)if(b[p]!=Object.prototype[p])if(p.toLowerCase()=="styleclass")v.setAttribute("class",b[p]);else p.toLowerCase()!="classid"&&v.setAttribute(p,b[p]);for(var B in d)d[B]!=
Object.prototype[B]&&B.toLowerCase()!="movie"&&z(v,B,d[B]);j.parentNode.replaceChild(v,j);h=v}}return h}function z(b,d,f){var h=A("param");h.setAttribute("name",d);h.setAttribute("value",f);b.appendChild(h)}function D(b){var d=o(b);if(d&&d.nodeName=="OBJECT")if(k.ie&&k.win){d.style.display="none";(function(){d.readyState==4?y(b):setTimeout(arguments.callee,10)})()}else d.parentNode.removeChild(d)}function y(b){if(b=o(b)){for(var d in b)if(typeof b[d]=="function")b[d]=null;b.parentNode.removeChild(b)}}
function o(b){var d=null;try{d=r.getElementById(b)}catch(f){}return d}function A(b){return r.createElement(b)}function fa(b,d,f){b.attachEvent(d,f);M[M.length]=[b,d,f]}function R(b){var d=k.pv;b=b.split(".");b[0]=parseInt(b[0],10);b[1]=parseInt(b[1],10)||0;b[2]=parseInt(b[2],10)||0;return d[0]>b[0]||d[0]==b[0]&&d[1]>b[1]||d[0]==b[0]&&d[1]==b[1]&&d[2]>=b[2]?true:false}function ca(b,d,f,h){if(!(k.ie&&k.mac)){var j=r.getElementsByTagName("head")[0];if(j){f=f&&typeof f=="string"?f:"screen";if(h)Z=F=null;
if(!F||Z!=f){h=A("style");h.setAttribute("type","text/css");h.setAttribute("media",f);F=j.appendChild(h);if(k.ie&&k.win&&typeof r.styleSheets!=u&&r.styleSheets.length>0)F=r.styleSheets[r.styleSheets.length-1];Z=f}if(k.ie&&k.win)F&&typeof F.addRule==E&&F.addRule(b,d);else F&&typeof r.createTextNode!=u&&F.appendChild(r.createTextNode(b+" {"+d+"}"))}}}function L(b,d){if(da){d=d?"visible":"hidden";if(K&&o(b))o(b).style.visibility=d;else ca("#"+b,"visibility:"+d)}}function ea(b){return/[\\\"<>\.;]/.exec(b)!=
null&&typeof encodeURIComponent!=u?encodeURIComponent(b):b}var u="undefined",E="object",Q="application/x-shockwave-flash",ba="SWFObjectExprInst",C=window,r=document,I=navigator,$=false,P=[l],H=[],U=[],M=[],N,T,Y,aa,K=false,S=false,F,Z,da=true,k=function(){var b=typeof r.getElementById!=u&&typeof r.getElementsByTagName!=u&&typeof r.createElement!=u,d=I.userAgent.toLowerCase(),f=I.platform.toLowerCase(),h=f?/win/.test(f):/win/.test(d);f=f?/mac/.test(f):/mac/.test(d);d=/webkit/.test(d)?parseFloat(d.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,
"$1")):false;var j=!+"\u000b1",p=[0,0,0],q=null;if(typeof I.plugins!=u&&typeof I.plugins["Shockwave Flash"]==E){if((q=I.plugins["Shockwave Flash"].description)&&!(typeof I.mimeTypes!=u&&I.mimeTypes[Q]&&!I.mimeTypes[Q].enabledPlugin)){$=true;j=false;q=q.replace(/^.*\s+(\S+\s+\S+$)/,"$1");p[0]=parseInt(q.replace(/^(.*)\..*$/,"$1"),10);p[1]=parseInt(q.replace(/^.*\.(.*)\s.*$/,"$1"),10);p[2]=/[a-zA-Z]/.test(q)?parseInt(q.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else if(typeof C.ActiveXObject!=u)try{var v=
new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(v)if(q=v.GetVariable("$version")){j=true;q=q.split(" ")[1].split(",");p=[parseInt(q[0],10),parseInt(q[1],10),parseInt(q[2],10)]}}catch(B){}return{w3:b,pv:p,wk:d,ie:j,win:h,mac:f}}();(function(){if(k.w3){if(typeof r.readyState!=u&&r.readyState=="complete"||typeof r.readyState==u&&(r.getElementsByTagName("body")[0]||r.body))a();if(!K){typeof r.addEventListener!=u&&r.addEventListener("DOMContentLoaded",a,false);if(k.ie&&k.win){r.attachEvent("onreadystatechange",
function(){if(r.readyState=="complete"){r.detachEvent("onreadystatechange",arguments.callee);a()}});C==top&&function(){if(!K){try{r.documentElement.doScroll("left")}catch(b){setTimeout(arguments.callee,0);return}a()}}()}k.wk&&function(){K||(/loaded|complete/.test(r.readyState)?a():setTimeout(arguments.callee,0))}();e(a)}}})();(function(){k.ie&&k.win&&window.attachEvent("onunload",function(){for(var b=M.length,d=0;d0)for(var g=0;g0)for(var m=0;m1)for(var w=
0;w=0){FABridge.attachBridge(l[w],a);s=true;break}}if(s)break}if(!s&&e>1)for(l=0;l=0){FABridge.attachBridge(c[l],a);break}}return true}FABridge.nextBridgeID=0;FABridge.instances={};FABridge.idMap={};FABridge.refCount=0;
FABridge.extractBridgeFromID=function(a){return FABridge.idMap[a>>16]};FABridge.attachBridge=function(a,c){a=new FABridge(a,c);FABridge[c]=a;var e=FABridge.initCallbacks[c];if(e!=null){for(var l=0;l0)throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
else{FABridge.refCount++;retVal=this.target.getPropFromAS(a,c);retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},setPropertyInAS:function(a,c,e){if(FABridge.refCount>0)throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");else{FABridge.refCount++;retVal=this.target.setPropInAS(a,c,this.serialize(e));retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},
callASFunction:function(a,c){if(FABridge.refCount>0)throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");else{FABridge.refCount++;retVal=this.target.invokeASFunction(a,this.serialize(c));retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},callASMethod:function(a,c,e){if(FABridge.refCount>0)throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
else{FABridge.refCount++;e=this.serialize(e);retVal=this.target.invokeASMethod(a,c,e);retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},invokeLocalFunction:function(a,c){var e;a=this.localFunctionCache[a];if(a!=undefined)e=this.serialize(a.apply(null,this.deserialize(c)));return e},getTypeFromName:function(a){return this.remoteTypeCache[a]},createProxy:function(a,c){c=this.getTypeFromName(c);instanceFactory.prototype=c;c=new instanceFactory(a);return this.remoteInstanceCache[a]=
c},getProxy:function(a){return this.remoteInstanceCache[a]},addTypeDataToCache:function(a){newType=new ASProxy(this,a.name);for(var c=a.accessors,e=0;e="a"&&e<="z"){l="get"+e.toUpperCase()+c.substr(1);e="set"+e.toUpperCase()+c.substr(1)}else{l=
"get"+c;e="set"+c}a[e]=function(g){this.bridge.setPropertyInAS(this.fb_instance_id,c,g)};a[l]=function(){return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,c))}},addMethodToType:function(a,c){a[c]=function(){return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id,c,FABridge.argsToArray(arguments)))}},getFunctionProxy:function(a){var c=this;if(this.remoteFunctionCache[a]==null)this.remoteFunctionCache[a]=function(){c.callASFunction(a,FABridge.argsToArray(arguments))};
return this.remoteFunctionCache[a]},getFunctionID:function(a){if(a.__bridge_id__==undefined){a.__bridge_id__=this.makeID(this.nextLocalFuncID++);this.localFunctionCache[a.__bridge_id__]=a}return a.__bridge_id__},serialize:function(a){var c={},e=typeof a;if(e=="number"||e=="string"||e=="boolean"||e==null||e==undefined)c=a;else if(a instanceof Array){c=[];for(e=0;e0&&FABridge.refCount--;throw new Error(a[1]);}else return a}};
ASProxy=function(a,c){this.bridge=a;this.typeName=c;return this};ASProxy.prototype={get:function(a){return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,a))},set:function(a,c){this.bridge.setPropertyInAS(this.fb_instance_id,a,c)},call:function(a,c){this.bridge.callASMethod(this.fb_instance_id,a,c)},addRef:function(){this.bridge.addRef(this)},release:function(){this.bridge.release(this)}};
(function(){function a(){if("navigator"in window&&"plugins"in navigator&&navigator.plugins["Shockwave Flash"])return!!navigator.plugins["Shockwave Flash"].description;if("ActiveXObject"in window)try{return!!(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(g){}return false}function c(g,m){return function(s){var w=new e;w.initEvent(m,true,true);w.target=w.currentTarget=g;for(var x in s)w[x]=s[x];g.dispatchEvent(w,arguments)}}function e(){}if(!window.WebSocket){var l=
window.console;l||(l={log:function(){},error:function(){}});if(a()){WebSocket=function(g,m,s,w,x){var i=this;i.readyState=WebSocket.CONNECTING;i.bufferedAmount=0;WebSocket.__addTask(function(){i.__flash=WebSocket.__flash.create(g,m,s||null,w||0,x||null);i.__flash.addEventListener("open",function(){try{i.onopen&&i.onopen()}catch(n){l.error(n.toString())}});i.__flash.addEventListener("close",function(){try{i.onclose&&i.onclose()}catch(n){l.error(n.toString())}});i.__flash.addEventListener("message",
function(n){n=decodeURIComponent(n.getData());try{if(i.onmessage){var t;if(window.MessageEvent){t=document.createEvent("MessageEvent");t.initMessageEvent("message",false,false,n,null,null,window)}else t={data:n};i.onmessage(t)}}catch(z){l.error(z.toString())}});i.__flash.addEventListener("stateChange",function(n){try{i.readyState=n.getReadyState();i.bufferedAmount=n.getBufferedAmount()}catch(t){l.error(t.toString())}})})};WebSocket.prototype.send=function(g){if(!this.__flash||this.readyState==WebSocket.CONNECTING)throw"INVALID_STATE_ERR: Web Socket connection has not been established";
g=this.__flash.send(g);if(g<0)return true;else{this.bufferedAmount=g;return false}};WebSocket.prototype.close=function(){if(this.__flash)if(this.readyState==WebSocket.OPEN){this.__flash.close();this.readyState=WebSocket.CLOSED;this.onclose&&this.onclose()}};WebSocket.prototype.addEventListener=function(g,m){if(!("__events"in this))this.__events={};if(!(g in this.__events)){this.__events[g]=[];if("function"==typeof this["on"+g]){this.__events[g].defaultHandler=this["on"+g];this["on"+g]=c(this,g)}}this.__events[g].push(m)};
WebSocket.prototype.removeEventListener=function(g,m){if(!("__events"in this))this.__events={};if(g in this.__events)for(var s=this.__events.length;s>-1;--s)if(m===this.__events[g][s]){this.__events[g].splice(s,1);break}};WebSocket.prototype.dispatchEvent=function(g){if(!("__events"in this))throw"UNSPECIFIED_EVENT_TYPE_ERR";if(!(g.type in this.__events))throw"UNSPECIFIED_EVENT_TYPE_ERR";for(var m=0,s=this.__events[g.type].length;m